walking云台入门教程-(Velocity-Based-Profile)驱动模式例程
文章说明
- 本教程主要介绍如何使用(Velocity-Based-Profile)驱动模式控制云台
- (Velocity-Based-Profile)驱动模式与(Time-Based-Profile)驱动模式不同,(Velocity-Based-Profile)驱动模式让你直接控制最大速度和加速度,从而能够更加灵活地调整舵机的运动
- 本教程目前只适用于gb2s和gb2l型号的云台
操作步骤
- 启动云台
$ ros2 launch walking_turret turret.launch.py
- 如果使用的仿真环境,则执行以下命令
$ ros2 launch walking_turret turret.launch.py use_sim:=true

- 启动脚本
$ ros2 launch walking_turret demo_velocity_profile_control.launch.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_type和tilt_profile_type都为velocity,表示使用(Velocity-Based-Profile)驱动模式来控制旋转 - 通过
profile_velocity和profile_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方法,同时控制pan和tilt舵机,且分别设定不同的速度和加速度 delay=3.0表示在等待3秒后,脚本才会继续执行
4.返回原点:
- 使用
pan_tilt_go_home方法将舵机移动回原点,且使用上一个运动的速度和加速度设置
5.结束任务:
- 最后通过
robot.shutdown()关闭并终止所有后台进程,完成控制
演示视频
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


















