需求
控制机器人模型在 rviz 中做圆周运动
实现流程
- 安装 Arbotix
- 创建新功能包,准备机器人 urdf、xacro 文件
- 添加 Arbotix 配置文件
- 编写 launch 文件配置 Arbotix
- 启动 launch 文件并控制机器人模型运动
添加 arbotix 所需的配置文件
在urdf01_rviz config中添加control.yaml文件
controllers: {
base_controller: {
type: diff_controller,
base_frame_id: base_footprint,
base_width: 0.2,
ticks_meter: 2000,
Kp: 12,
Kd: 12,
Ki: 0,
Ko: 50,
accel_limit: 1.0
}
}
添加launch文件 demo07_control.launch
<launch>
<param name = "robot_description" command = "$(find xacro)/xacro $(find urdf01_rviz)/urdf/xacro/car.urdf.xacro" />
<node pkg = "rviz" type = "rviz" name = "rviz" args = "-d $(find urdf01_rviz)/config/show_mycar.rviz"/>
<node pkg = "joint_state_publisher" type = "joint_state_publisher" name = "joint_state_publisher" />
<node pkg = "robot_state_publisher" type = "robot_state_publisher" name = "robot_state_publisher" />
<node pkg = "arbotix_python" type = "arbotix_driver" name = "driver" output = "screen" >
<rosparam command = "load" file = "$(find urdf01_rviz)/config/control.yaml" />
<param name = "sim" value = "true" />
</node>
</launch>
rostopic list
/clicked_point
/cmd_vel
/diagnostics
/initialpose
/joint_states
/move_base_simple/goal
/odom
/rosout
/rosout_agg
/tf
/tf_static
rostopic pub -r 10 /cmd_vel geometry_msgs/Twist “linear:
x: 1.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 1.0”
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)