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 » walking云台入门教程 » walking云台入门教程-(Time-Based-Profile)驱动模式例程

walking云台入门教程-(Time-Based-Profile)驱动模式例程

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

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

文章说明

  • 本教程主要介绍如何使用(Time-Based-Profile)驱动模式控制云台
  • (Time-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_time_profile_control.launch.py
[INFO] [1730793137.421259118] [interbotix_robot_manipulation]: Initialized InterbotixRobotNode!
[INFO] [1730793138.215698710] [interbotix_robot_manipulation]: 
	Robot Name: pxxls
	Robot Model: pxxls
[INFO] [1730793138.216145189] [interbotix_robot_manipulation]: Initialized InterbotixRobotXSCore!
[INFO] [1730793138.347649953] [interbotix_robot_manipulation]: Turret Group Name: turret
Pan Name: pan, Profile Type: time, Profile Velocity: 2.0, Profile Acceleration: 0.3
Tilt Name: tilt, Profile Type: time, Profile Velocity: 2.0, Profile Acceleration: 0.3
[INFO] [1730793138.348076943] [interbotix_robot_manipulation]: Initialized InterbotixTurretXSInterface!
1.0
1.5

脚本解析

1.初始化:

  • 创建一个InterbotixTurretXS实例,指定机器人模型为pxxls,并且设置pan_profile_typetilt_profile_type都为time,表示使用(Time-Based-Profile)驱动模式来控制旋转

2.控制舵机的运动:

  • pan舵机运动:将pan舵机移动到1.0弧度,设置运动的持续时间为1秒,且加速和减速的时间为0.5秒,blocking=True表示脚本会等待运动完成再继续执行后续命令
  • tilt舵机运动:将tilt舵机移动到1.5弧度,设置运动的持续时间为1.5秒,且加速和减速的时间为0.3秒

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

  • 使用pan_tilt_move方法,同时控制pantilt舵机
  • 分别设定pantilt的目标位置为[-0.8, -1]弧度,且分别设置加速度和速度

4.返回原点:

  • 使用pan_tilt_go_home方法将舵机移动回原点,即pan舵机和tilt舵机都返回0弧度

5.结束任务:

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

演示视频

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

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

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


标签: none