qbrobotics五指灵巧手/qb soft hand使用概要

7 篇文章 1 订阅

qbrobotics五指灵巧手/qb soft hand使用概要

qbhand

1 驱动及ROS包安装

2 连接及使用

2.1 单纯连接qb_hand

roslaunch qb_device_driver communication_handler.launch

On start, it scans the serial communication resources connected to you system and shows a list of the devices it has found. By default it never scans again for new devices, apart from asking it explicitly during the initialization of a control Node.
This is a simple example when starting the Communication Handler with two qbrobotics® devices connected on two distinct USB ports:

2.2 GUI控制

  • 打开GUI方法:
roslaunch qb_hand_control control.launch standalone:=true activate_on_initialization:=true use_controller_gui:=true

这种方法应该是没啥用,就是拉动进度条控制夹持器的开合程度(0-1)及速度(0-100%)。
GUI

This control mode is the one suggested to test that everything is working as expected.
You will probably need this only the very first times and for debugging.

2.3 Waypoints控制

简单来说,就是让夹持器按照config/<robot_name>_waypoints.yaml中的waypoints循环动作。官方默认的waypoints格式如下:

waypoints:
  -
    time: [2.0]
    joint_positions:
      qbhand: [0.0]
  -
    time: [4.0, 4.2]
    joint_positions:
      qbhand: [0.8]
  • 启动waypoint控制的命令
roslaunch qb_hand_control control.launch standalone:=true activate_on_initialization:=true use_waypoints:=true device_name:=qbhand

注意:

  • 设置use_waypoints:=true时,不能再设置use_controller_gui:=true
  • yaml文件的名称格式是<robot_name>_waypoints.yaml,如默认为qbhand_waypoints.yaml,但yaml文件(见上)中有一个参数为device_name,而device_namecontrol.launch中默认定义为<robot_name>+<device_id>,所以如果要使用默认的例程(device_name被写死为qbhand),务必重新传入参数device_name:=qbhand

2.4 API控制

按照qb_device_control.hqb_device_control.cpp的思路扩展即可。

2.5 通过rostopic pub发送topic控制

这个其实和API控制本质上是一样的,都是通过topic或者action。参考自:How to use the package!。具体步骤:

(1) 连接及启动qb_hand
roslaunch qb_hand_control control.launch standalone:=true activate_on_initialization:=true device_id:=1 device_name:=my_hand

参数含义(打开launch文件全都可以看到):

  • standalone: Choose whether or not to start the Communication Handler, default is false.
    设置为true的话,上面的连接qb_hand的命令就不需要单独执行了。
  • activate_on_initialization: Activates the motor at startup (the device will not move since the first command reference is received).
  • device_id: Each device has its own ID, you need to set the one of the actual device connect to your system.(单个qb设备直接忽略,多个设备时才需要设置。)
  • device_name: The unique device name used in the yaml controller configurations (also in the urdf if not already specified there) (单个qb设备直接忽略,多个设备时才需要设置。)
    其他有可能用上的参数:
  • use_rviz: Choose whether or not to use rviz.
  • use_controller_gui:
  • use_waypoints: Choose whether or not to use the waypoint references. Waypoint Control
(2)发送控制信息(使用tab补全)
rostopic pub -1 /my_hand/control/my_hand_synergy_trajectory_controller/command trajectory_msgs/JointTrajectory "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
joint_names:
- 'my_hand_synergy_joint'
points:
- positions: [0.5]
  velocities: [0]
  accelerations: [0]
  effort: [0]
  time_from_start: {secs: 1, nsecs: 0}"
### 集成五指灵巧到Gazebo并使用MoveIt 为了在Gazebo环境中集成五指灵巧并与MoveIt框架协同工作,需遵循一系列特定流程来确保两者之间的无缝协作。此过程涉及多个方面的工作,包括但不限于模型导入、配置MoveIt以及建立Gazebo与MoveIt间的通信。 #### 模型准备与导入 首先,获取适用于目标平台的五指灵巧URDF/XACRO模型文件,并将其放置于ROS工作区内的适当位置。这一步骤至关重要,因为后续所有的操作都将基于该模型展开[^2]。 ```bash roscd my_robot_description/ cp /path/to/five_finger_hand_model.urdf.xacro . ``` #### 使用MoveIt Setup Assistant进行配置 启动`moveit_setup_assistant`工具来进行必要的参数设定。通过图形界面完成关节定义、规划组划分等工作,最终生成适配当前机器人的功能包[^1][^3]。 ```bash rosrun moveit_setup_assistant setup_assistant ``` #### 建立Gazebo与MoveIt间联系 创建或修改现有的`.launch`文件以加载控制器插件,从而实现在仿真环境下对物理属性的有效控制。对于多自由度的部结构而言,可能还需要额外编写自定义的动作接口用于高级交互逻辑处理[^4]。 ```xml <!-- marm_gazebo/launch/arm_trajectory_controller.launch --> <launch> <!-- 加载机器人描述 --> <param name="robot_description" command="$(find xacro)/xacro '$(find my_robot_description)/urdf/my_robot_with_hand.urdf.xacro'" /> <!-- 启动Gazebo世界 --> <include file="$(find gazebo_ros)/launch/empty_world.launch"> <arg name="paused" value="false"/> <arg name="use_sim_time" value="true"/> ... </include> <!-- 插入其他必要组件 --> </launch> ``` #### 编写运动控制代码 最后,在Python或其他支持的语言中开发具体的动作序列脚本,使模拟器内虚拟对象能够按照预期执行指定任务。例如让指抓取物体或是模仿人类势等复杂行为模式。 ```python import rospy from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint def main(): pub = rospy.Publisher('/five_finger_hand/joint_path_command', JointTrajectory, queue_size=10) rospy.init_node('hand_motion_publisher') jt = JointTrajectory() point = JointTrajectoryPoint() # 设置轨迹点的位置和其他属性... if __name__ == '__main__': try: main() except rospy.ROSInterruptException as e: pass ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

lyh458

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值