robot state publisher以及joint state publisher

https://blog.csdn.net/weixin_36965307/article/details/104945052

robot state publisher

http://wiki.ros.org/robot_state_publisher
This package allows you to publish the state of a robot to tf. Once the state gets published, it is available to all components in the system that also use tf. The package takes the joint angles of the robot as input and publishes the 3D poses of the robot links, using a kinematic tree model of the robot. The package can both be used as a library and as a ROS node. This package has been well tested and the code is stable. No major changes are planned in the near future.

  <node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
    <param name="publish_frequency" type="double" value="50.0" />
    <param name="tf_prefix" type="string" value="" />
  </node>

/gazebo —— /joint states—— /robot state publisher

joint state publisher

http://wiki.ros.org/joint_state_publisher
This package contains a tool for setting and publishing joint state values for a given URDF。
This package publishes sensor_msgs/JointState messages for a robot. The package reads the robot_description parameter from the parameter server, finds all of the non-fixed joints and publishes a JointState message with all those joints defined.

This package can be used in conjunction with the robot_state_publisher node to also publish transforms for all joint states.

 <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher" output="screen" />
 <param name="use_gui" value="$(arg gui)"/>




  <!-- We do not have a robot connected, so publish fake joint states -->
  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
    <param name="use_gui" value="$(arg use_gui)"/>
    <rosparam param="source_list">[move_group/fake_controller_joint_states]</rosparam>
  </node>

joint state controller

Publishes the state of all resources registered to a hardware_interface::JointStateInterface to a topic of type sensor_msgs/JointState.

joint_state_controller

https://blog.csdn.net/lovedarling/article/details/78291508

需要加载yaml文件:

joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  



 <!-- joint_state_controller -->
  <rosparam file="$(find ur_gazebo)/controller/joint_state_controller.yaml" command="load"/>
  <node name="joint_state_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn joint_state_controller" respawn="false" output="screen"/>
  

总结

主要在gazebo中用到了两个接口,

一个joint trajectory contreller (gazebo)就是轨迹生成器,在硬件接口中的实现
一个joint state controller(gazebo) 发布与硬件接口相关的资源状态

一般性在controller trils.launch中提供了robot state publisher 以及 joins state controller。
joint trajectory controller

轨迹控制部分单独写:

<!-- start this controller -->
  <rosparam file="$(find ur_gazebo)/controller/arm_controller_ur3.yaml" command="load"/>
  <node name="arm_controller_spawner" pkg="controller_manager" type="controller_manager" args="spawn arm_controller" respawn="false" output="screen"/>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值