我正在将Gazebo和ROS用于机器人模型。我刚刚在机器人的关节上添加了力/扭矩传感器。来自该传感器的数据将发布到gz主题"/gazebo/myworld/snakebot/joint_0${num}/sensor_02${num}/wrench"
。我的关节和传感器描述如下:
<joint name="joint_0${num}" type="continuous">
<provideFeedback>true</provideFeedback>
<parent link="body_0${num}"/>
<child link="body_0${nextNum}"/>
<origin xyz="${chassisLength/2 + jointOffset} 0 ${chassisHeight/2}" rpy="0 0 0" />
<axis xyz="0 0 1" rpy="0 0 0" />
<limit effort="100" velocity="1"/>
<joint_properties damping="100.0" friction="0.0"/>
</joint>
<!-- Sensor -->
<gazebo reference="joint_0${num}">
<sensor name="sensor_0${num}" type="force_torque">
<always_on>true</always_on>
<update_rate>30</update_rate>
<force_torque>
<frame>joint_0${num}</frame>
<measure_direction>child_to_parent</measure_direction>
</force_torque>
</sensor>
</gazebo>
我可以从终端查看该主题的内容,但是我希望从ROS订阅该主题。有什么方法可以将数据从凉亭重新发布到ROS?
(我也尝试使用
ft_sensor
插件并设法从ROS订阅了它的主题,但是值始终为零...)非常感谢您的任何帮助:)谢谢!
最佳答案
从this discussion on gazebo-sim
For ros topics to be populated by gazebo there must be some gazebo plugin running, actually publishing some ROS messages. Otherwise, gazebo will be on its own.
您可以尝试修改:https://github.com/wonwon0/gazebo_contact_republisher
关于c++ - 将凉亭主题发布到rostopic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60752786/