Arm movement and control

From RobotForAll
Jump to: navigation, search

Quick start with TurtleBot Arm

Download source code here:

https://github.com/robocupathomeedu/rc-home-edu-learn-ros/tree/master/rchomeedu_arm


Arm bringup:

$ roslaunch rchomeedu_arm arm.launch

Attention: if come up with this error:

$ serial.serialutil.SerialException: [Errno 2] could not open port /dev/ttyUSB1: [Errno 2] No such file or directory: '/dev/ttyUSB1'
 ================================================================================
 REQUIRED process [dynamixel_manager-2] has died!
  process has died [pid 25540, exit code 1, cmd /opt/ros/kinetic/lib/dynamixel_controllers/controller_manager.py 
  __name:=dynamixel_manager __log:=/home/kamerider/.ros/log/6b6c241c-ae0d-11e9-bb2a-ccb0dab477b9/dynamixel_manager
  -2.log].
  log file: /home/kamerider/.ros/log/6b6c241c-ae0d-11e9-bb2a-ccb0dab477b9/dynamixel_manager-2*.log
  Initiating shutdown!
 ================================================================================

change the serial port no. here:

 1         <rosparam>
 2             namespace: dxl_manager
 3             serial_ports:
 4                 pan_tilt_port:
 5                     port_name: "/dev/ttyUSB1"
 6                     baud_rate: 1000000
 7                     min_motor_id: 1
 8                     max_motor_id: 5
 9                     update_rate: 20
10         </rosparam>

And if error like:

$ Permission denied: '/dev/ttyUSB0'

In terminal:

$ sudo chmod 777 /dev/ttyUSB0


Control the joints by publishing topics, for example:

$ pub -1 /wrist_controller/command std_msgs/Float64 "data: 1.0" 

Try the demo:

$ rosrun rchomeedu_arm arm.py

Attention: the message data refers to absolute position of joints

Arm joints.jpg