turtlebot3-burger_150.png
turtlebot3-waffle-pi_150.png
turtlebot3-arm_150.png
walking-y2_150.png
turbot3-multi_150.png
turbot3-dl-ros1_150.png
turbot3-ai.png
turbot3-dl-ros2_150.png
turbot3-slam_150.png
turbot3-arm_150.png
turtlebot4-lite_150.png
turtlebot4-pro_150.png
turbot4-dl_150.png
turbot4-ai_150.png
aidriving-racebot_150.png
aidriving-autodrive_150.png
turtlebot-arm_150.png
openmanipulator-x_150.png
Home » ROS2与Interbotix云台快速入门教程 » ROS2与Interbotix云台快速入门教程-(Velocity-Based-Profile)驱动模式例程

ROS2与Interbotix云台快速入门教程-(Velocity-Based-Profile)驱动模式例程

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号

文章说明

  • 本教程主要介绍如何通过interbotix_ros_turrets包中自带的demo来学习使用(Velocity-Based-Profile)驱动模式控制云台
  • (Velocity-Based-Profile)驱动模式与(Time-Based-Profile)驱动模式不同,(Velocity-Based-Profile)驱动模式让你直接控制最大速度和加速度,从而能够更加灵活地调整舵机的运动

操作步骤

  • 启动云台
$ ros2 launch interbotix_xsturret_control xsturret_control.launch.py robot_model:=pxxls
  • 如果使用的仿真环境,则执行以下命令
$ ros2 launch interbotix_xsturret_control xsturret_control.launch.py robot_model:=pxxls use_sim:=true

请输入图片描述

  • 启动脚本
$ cd ~/ros2_interbotix_ws/src/interbotix_ros_turrets/interbotix_ros_xsturrets/interbotix_xsturret_control/demos
$ python3 turret_velocity_profile_control.py 
[INFO] [1730797077.622085049] [interbotix_robot_manipulation]: Initialized InterbotixRobotNode!
[INFO] [1730797077.921095163] [interbotix_robot_manipulation]: 
	Robot Name: pxxls
	Robot Model: pxxls
[INFO] [1730797077.921430601] [interbotix_robot_manipulation]: Initialized InterbotixRobotXSCore!
[INFO] [1730797078.053713531] [interbotix_robot_manipulation]: Turret Group Name: turret
Pan Name: pan, Profile Type: velocity, Profile Velocity: 131.0, Profile Acceleration: 131.0
Tilt Name: tilt, Profile Type: velocity, Profile Velocity: 65.0, Profile Acceleration: 5.0
[INFO] [1730797078.054157140] [interbotix_robot_manipulation]: Initialized InterbotixTurretXSInterface!

脚本解析

1.初始化:

  • 创建一个InterbotixTurretXS实例,指定机器人模型为pxxls,并且设置pan_profile_typetilt_profile_type都为velocity,表示使用(Velocity-Based-Profile)驱动模式来控制旋转
  • 通过profile_velocityprofile_acceleration参数设置pan舵机和tilt舵机的最大速度和加速度

2.控制舵机的运动:

  • pan舵机运动:使用指定的速度和加速度将pan舵机移动到1.0弧度,delay=1.0表示在等待1秒后,脚本才会继续执行
  • tilt舵机运动:使用指定的速度和加速度将tilt舵机移动到1.5弧度,delay=2.0表示在等待2秒后,脚本才会继续执行

3.同时控制Pan舵机和Tilt舵机:

  • 使用pan_tilt_move方法,同时控制pantilt舵机,且分别设定不同的速度和加速度
  • delay=3.0表示在等待3秒后,脚本才会继续执行

4.返回原点:

  • 使用pan_tilt_go_home方法将舵机移动回原点,且使用上一个运动的速度和加速度设置

5.结束任务:

  • 最后通过robot.shutdown()关闭并终止所有后台进程,完成控制

演示视频

<iframe height=498 width=100% src="//player.bilibili.com/player.html?isOutside=true&aid=113433659835002&bvid=BV1iiDgYdEBX&cid=26635669259&p=1&high_quality=1&danmaku=0 " scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>

纠错,疑问,交流: 请进入讨论区请点击进入页面,扫码加入微信群或Q群进行交流

获取最新文章: 扫一扫加入“创客智造”公众号


标签: none