< >
Home » PhantomXArm入门教程 » ROS与PhantomXArm教程-测试机械臂

ROS与PhantomXArm教程-测试机械臂

ROS与PhantomXArm教程-测试机械臂

说明

  • 介绍如何使用arbotix_gui来测试机械臂

修改端口:

  • 修改配置文件:
$ rosed turtlebot_arm_bringup pincher_arm.yaml
  • 修改port: /dev/ttyUSB0port: /dev/arbotix即可

  • 修改内容如下:

port: /dev/arbotix
read_rate: 15
write_rate: 25
joints: {
    arm_shoulder_pan_joint: {id: 1, neutral: 205, max_angle: 180, min_angle: -60, max_speed: 90},
    arm_shoulder_lift_joint: {id: 2, max_angle: 150, min_angle: -150, max_speed: 90},
    arm_elbow_flex_joint: {id: 3, max_angle: 150, min_angle: -150, max_speed: 90},
    arm_wrist_flex_joint: {id: 4, max_angle: 100, min_angle: -100, max_speed: 90},
    gripper_joint: {id: 5, max_angle: 0, min_angle: -145, max_speed: 90, type: prismatic, radius: .0078, connector: .024, offset: .016}
}
controllers: {
    arm_controller: {type: follow_controller, joints: [arm_shoulder_pan_joint, arm_shoulder_lift_joint, arm_elbow_flex_joint, arm_wrist_flex_joint], action_name: arm_controller/follow_joint_trajectory, onboard: False }
}
  • 配置机械臂使用picher
$ echo "export TURTLEBOT_ARM1=pincher" >> ~/.bashrc 
$ source ~/.bashrc 
  • 新终端,启动arm
$ roslaunch turtlebot_arm_bringup arm.launch

... logging to /home/ubuntu/.ros/log/ca3dc738-294c-11ea-bc80-000c29799d34/roslaunch-PhantomXArm-virtual-machine-3632.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.


started roslaunch server http://PhantomXArm-virtual-machine:42619/

SUMMARY
========

PARAMETERS
 * /arbotix/controllers/arm_controller/action_name: arm_controller/fo...
 * /arbotix/controllers/arm_controller/joints: ['arm_shoulder_pa...
 * /arbotix/controllers/arm_controller/onboard: False
 * /arbotix/controllers/arm_controller/type: follow_controller
 * /arbotix/joints/arm_elbow_flex_joint/id: 3
 * /arbotix/joints/arm_elbow_flex_joint/max_angle: 136
 * /arbotix/joints/arm_elbow_flex_joint/max_speed: 90
 * /arbotix/joints/arm_elbow_flex_joint/min_angle: -139
 * /arbotix/joints/arm_elbow_flex_joint/type: dynamixel
 * /arbotix/joints/arm_shoulder_lift_joint/id: 2
 * /arbotix/joints/arm_shoulder_lift_joint/max_angle: 126
 * /arbotix/joints/arm_shoulder_lift_joint/max_speed: 90
 * /arbotix/joints/arm_shoulder_lift_joint/min_angle: -119
 * /arbotix/joints/arm_shoulder_lift_joint/type: dynamixel
 * /arbotix/joints/arm_shoulder_pan_joint/id: 1
 * /arbotix/joints/arm_shoulder_pan_joint/max_angle: 140
 * /arbotix/joints/arm_shoulder_pan_joint/max_speed: 90
 * /arbotix/joints/arm_shoulder_pan_joint/min_angle: -140
 * /arbotix/joints/arm_shoulder_pan_joint/neutral: 512
 * /arbotix/joints/arm_shoulder_pan_joint/type: dynamixel
 * /arbotix/joints/arm_wrist_flex_joint/id: 4
 * /arbotix/joints/arm_wrist_flex_joint/max_angle: 96
 * /arbotix/joints/arm_wrist_flex_joint/max_speed: 90
 * /arbotix/joints/arm_wrist_flex_joint/min_angle: -98
 * /arbotix/joints/arm_wrist_flex_joint/type: dynamixel
 * /arbotix/joints/gripper_joint/connector: 0.024
 * /arbotix/joints/gripper_joint/id: 5
 * /arbotix/joints/gripper_joint/max_angle: 0
 * /arbotix/joints/gripper_joint/max_speed: 90
 * /arbotix/joints/gripper_joint/min_angle: -145
 * /arbotix/joints/gripper_joint/offset: 0.016
 * /arbotix/joints/gripper_joint/radius: 0.0078
 * /arbotix/joints/gripper_joint/type: prismatic
 * /arbotix/port: /dev/arbotix
 * /arbotix/read_rate: 15
 * /arbotix/sim: False
 * /arbotix/source: pincher_arm.yaml
 * /arbotix/write_rate: 25
 * /gripper_controller/center: 0
 * /gripper_controller/invert: False
 * /gripper_controller/joint: gripper_joint
 * /gripper_controller/max_opening: 0.031
 * /gripper_controller/min_opening: 0.002
 * /gripper_controller/model: parallel
 * /gripper_controller/neutral: 0.015
 * /gripper_controller/pad_width: 0.002
 * /gripper_controller/source: pincher_gripper.yaml
 * /gripper_controller/tighten: 0.001
 * /robot_description: <?xml version="1....
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    arbotix (arbotix_python/arbotix_driver)
    fake_joint_pub (turtlebot_arm_bringup/fake_joint_pub.py)
    gripper_controller (arbotix_controllers/gripper_controller)
    robot_state_pub (robot_state_publisher/robot_state_publisher)

auto-starting new master
process[master]: started with pid [3645]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to ca3dc738-294c-11ea-bc80-000c29799d34
process[rosout-1]: started with pid [3658]
started core service [/rosout]
process[robot_state_pub-2]: started with pid [3675]
process[fake_joint_pub-3]: started with pid [3676]
process[arbotix-4]: started with pid [3677]
process[gripper_controller-5]: started with pid [3684]
[INFO] [1577522039.164797]: Started parallel Gripper Controller.
[INFO] [1577522040.714006]: Started ArbotiX connection on port /dev/arbotix.
[INFO] [1577522040.771321]: Started Servo 3  arm_elbow_flex_joint
[INFO] [1577522040.804794]: Started Servo 4  arm_wrist_flex_joint
[INFO] [1577522040.835350]: Started Servo 2  arm_shoulder_lift_joint
[INFO] [1577522040.863141]: Started Servo 1  arm_shoulder_pan_joint
[INFO] [1577522040.892207]: Started Servo 5  gripper_joint
[INFO] [1577522040.907751]: gripper_joint prismatic joint
[INFO] [1577522040.927929]: Started FollowController (arm_controller). Joints: ['arm_shoulder_pan_joint', 'arm_shoulder_lift_joint', 'arm_elbow_flex_joint', 'arm_wrist_flex_joint'] on C1
[INFO] [1577522040.938063]: ArbotiX connected.
  • 新终端,执行gui
$ arbotix_gui
  • 效果图:

请输入图片描述

  • 想控制那个电机,勾选上,然后拖动进度条
  • 效果图2:

请输入图片描述

  • 查看话题
$ rostopic list

/arm_controller/command
/arm_controller/follow_joint_trajectory/cancel
/arm_controller/follow_joint_trajectory/feedback
/arm_controller/follow_joint_trajectory/goal
/arm_controller/follow_joint_trajectory/result
/arm_controller/follow_joint_trajectory/status
/arm_elbow_flex_joint/command
/arm_shoulder_lift_joint/command
/arm_shoulder_pan_joint/command
/arm_wrist_flex_joint/command
/cmd_vel
/diagnostics
/gripper_controller/gripper_action/cancel
/gripper_controller/gripper_action/feedback
/gripper_controller/gripper_action/goal
/gripper_controller/gripper_action/result
/gripper_controller/gripper_action/status
/gripper_joint/command
/joint_states
/rosout
/rosout_agg
/tf
/tf_static
  • 查看机械臂的关节状态
$ rostopic echo /joint_states

header: 
  seq: 4895
  stamp: 
    secs: 1583981889
    nsecs: 924238920
  frame_id: ''
name: [arm_elbow_flex_joint, gripper_joint, arm_shoulder_lift_joint, arm_shoulder_pan_joint,
  arm_wrist_flex_joint]
position: [-1.4214888634406941, 0.02847037044847476, -0.09715211656609062, 0.3119094268700804, 0.4039482741432189]
velocity: [0.0, 0.0, 0.0, 0.0, 0.0]
effort: []

问题

  • 运行arbotix_gui错误:
wxPyDeprecationWarning: Using deprecated class PySimpleApp
  • 解决:https://wenda.ncnynl.com/question/193

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: ROS与PhantomXArm教程