Turbot4-ARM仿真入门教程-通过命令控制机械爪
说明
- 介绍如何通过命令控制机械爪
步骤
- 启动仿真
#加载仿真环境
. /usr/share/gazebo/setup.bash
#gazebo
ros2 launch interbotix_xslocobot_sim xslocobot_gz_classic_nav.launch.py robot_model:=locobot_wx200 verbose:=true
- gazebo效果图
- 相关命令
机械臂关节通过话题/locobot/gripper_controller/joint_trajectory控制
使用命令格式如下:
ros2 topic pub /locobot/gripper_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
joint_names: ['left_finger', 'right_finger']
points:
- positions: [1.0, -1.0]
velocities: []
accelerations: []
effort: []
time_from_start:
sec: 1
nanosec: 0"
- 分别通过控制左手指和右手指开合
- 通过positions来定义左手指和右手指关节的位置,位置采用弧度表示。
- 可以通过srdf文件定义关节对应的姿态位
<group_state name="Home" group="interbotix_gripper">
<joint name="left_finger" value="0.0195" />
<joint name="right_finger" value="-0.0195" />
</group_state>
<group_state name="Released" group="interbotix_gripper">
<joint name="left_finger" value="0.037" />
<joint name="right_finger" value="-0.037" />
</group_state>
<group_state name="Grasping" group="interbotix_gripper">
<joint name="left_finger" value="0.015" />
<joint name="right_finger" value="-0.015" />
</group_state>
- home位
ros2 topic pub /locobot/gripper_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
joint_names: ['left_finger', 'right_finger']
points:
- positions: [0.0195, -0.0195]
velocities: []
accelerations: []
effort: []
time_from_start:
sec: 1
nanosec: 0"
- rviz效果图
- 打开
ros2 topic pub /locobot/gripper_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
joint_names: ['left_finger', 'right_finger']
points:
- positions: [0.037, -0.037]
velocities: []
accelerations: []
effort: []
time_from_start:
sec: 1
nanosec: 0"
- rviz效果图
- 关闭
ros2 topic pub /locobot/gripper_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
joint_names: ['left_finger', 'right_finger']
points:
- positions: [0.015, -0.015]
velocities: []
accelerations: []
effort: []
time_from_start:
sec: 1
nanosec: 0"
- rviz效果图
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号