Note: This tutorial assumes that you have completed the previous tutorials: ROS tutorials.

How to use a Crust Crawler Smart Arm with Dual Gripper with the smart_arm node

Description: This tutorial describes how to configure the smart_arm node for use with your Crust Crawler Smart Arm with Dual Gripper.

Keywords: robotis, dynamixel, crustcrawler, smart arm

Tutorial Level: BEGINNER

Next Tutorial: smart_arm_controller/Tutorials/Controlling a Smart Arm

Compiling

First, you need to compile all dependencies, ensuring all ROS msgs are generated.

$ rosmake smart_arm_controller

Configuring ROS Parameters

Controller Manager Launch File Parameters

Using a text editor, open the launch/smart_arm.launch in the smart_arm_controller package. Verify that the port name and baudrate are consistent with your hardware's configuration. By default, the Dynamixel motors operate at a baudrate of 57,600 or 1,000,000 bps. If you are using custom Dynamixel ids you can change the min_motor_id and max_motor_id parameters to account for large id numbers. The parameters in the launch file will look something like this:

http://ua-ros-pkg.googlecode.com/svn/trunk/arrg/crustcrawler_smart_arm/smart_arm_controller/launch/smart_arm.launch

   1 <!-- -*- mode: XML -*- -->
   2 
   3 <launch>
   4     <!-- Start the Dynamixel motor manager to control all SmartArm servos -->
   5     <node name="smartarm_motor_manager" pkg="dynamixel_controllers" type="controller_manager.py" required="true" output="screen">
   6         <rosparam>
   7             namespace: smartarm_motor_manager
   8             diagnostics_rate: 10
   9             serial_ports:
  10                 smart_arm:
  11                     port_name: "/dev/ttyUSB0"
  12                     baud_rate: 1000000
  13                     min_motor_id: 1
  14                     max_motor_id: 8
  15                     update_rate: 50
  16         </rosparam>
  17     </node>
  18 
  19     <!-- Load joint controller configuration from YAML file to parameter server -->
  20     <rosparam file="$(find smart_arm_controller)/config/smart_arm.yaml" command="load"/>
  21 
  22     <!-- Start all SmartArm joint controllers -->
  23     <node name="smartarm_controller_spawner" pkg="dynamixel_controllers" type="controller_spawner.py"
  24           args="--manager=smartarm_motor_manager
  25                 --port=smart_arm
  26                 --type=simple
  27                 shoulder_pan_controller
  28                 shoulder_pitch_controller
  29                 elbow_flex_controller
  30                 wrist_roll_controller
  31                 right_finger_controller
  32                 left_finger_controller"
  33           output="screen"/>
  34 </launch>

YAML File Parameters

Using a text editor, open the config/smart_arm.yaml in the smart_arm_controller package. Verify that the motor ids in the YAML file are consistent with your hardware configuration. For joints with two motors, make sure to specify the left motor id first (aka, the motor_master). The YAML file will look something like this:

http://ua-ros-pkg.googlecode.com/svn/trunk/arrg/crustcrawler_smart_arm/smart_arm_controller/config/smart_arm.yaml

shoulder_pan_controller:
    controller:
        package: dynamixel_controllers
        module: joint_position_controller
        type: JointPositionController
    joint_name: shoulder_pan_joint
    joint_speed: 1.17
    motor:
        id: 1
        init: 512
        min: 273
        max: 751

shoulder_pitch_controller:
    controller:
        package: dynamixel_controllers
        module: joint_position_controller_dual_motor
        type: JointPositionControllerDual
    joint_name: shoulder_pitch_joint
    joint_speed: 1.17
    motor_master:
        id: 2
        init: 512
        min: 717
        max: 126
    motor_slave:
        id: 3

elbow_flex_controller:
    controller:
        package: dynamixel_controllers
        module: joint_position_controller_dual_motor
        type: JointPositionControllerDual
    joint_name: elbow_flex_joint
    joint_speed: 1.17
    motor_master:
        id: 4
        init: 512
        min: 881
        max: 126
    motor_slave:
        id: 5

wrist_roll_controller:
    controller:
        package: dynamixel_controllers
        module: joint_position_controller
        type: JointPositionController
    joint_name: wrist_roll_joint
    joint_speed: 1.17
    motor:
        id: 6
        init: 512
        min: 1023
        max: 0

right_finger_controller:
    controller:
        package: dynamixel_controllers
        module: joint_position_controller
        type: JointPositionController
    joint_name: right_finger_joint
    joint_speed: 1.17
    motor:
        id: 7
        init: 676
        min: 512
        max: 724

left_finger_controller:
    controller:
        package: dynamixel_controllers
        module: joint_position_controller
        type: JointPositionController
    joint_name: left_finger_joint
    joint_speed: 1.17
    motor:
        id: 8
        init: 347
        min: 300
        max: 512

An explanation of these parameters can be found in the dynamixel_controllers package documentation.

Test Configuration

Using the launch file launch/smart_arm.launch you can test your configuration.

$ roslaunch smart_arm_controller smart_arm.launch

You should see the standard ROS launch output followed by something like this:

  • [INFO] 1295282870.051953: Pinging motor IDs 1 through 8...
    [INFO] 1295282870.103676: Found motors with IDs: [1,2,3,4,5,6,7,8].
    [INFO] 1295282870.141504: There are 8 AX-12+ servos connected
    [INFO] 1295282870.141857: Dynamixel Manager on port /dev/ttyUSB0 initialized

Verify that the motor ids on your Smart Arm are consistent with those found by the smart_arm node.

Joint State Publishing

Now that the smart_arm node is configured for your Smart Arm hardware, you can look at the joint state topic and see the feedback from the motors. To see the joint state messages, echo one of the joint controller topics:

$ rostopic echo /shoulder_pan_controller/state

You should see something like this:

Wiki: smart_arm_controller/Tutorials/Getting Started with a Smart Arm (last edited 2011-09-10 16:25:39 by AntonsRebguns)