User Tools

Site Tools


dynamixel:ros

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
dynamixel:ros [2018/09/27 17:10] – created typosdynamixel:ros [2024/09/23 13:37] (current) typos
Line 2: Line 2:
 --------------------------------------------- ---------------------------------------------
  
-Here, we walk through set up and example scripts to communicate with connected Dynamixel motors, using Matlab+This section refers you to instructions for installing the ROS Dynamixel motor stack as well as associated tutorials to operate the motors on ROS
  
-**PREREQUISITE:** This assumes instructions in [[dynamixel:hardware | hardware setup ]] have been completed.+**Prerequisite:** This assumes:
  
-===== Clone Repositories  ===== +  - instructions in [[dynamixel:hardware | hardware setup ]] have been completed. 
-Clone the 'dynamixel' repository maintained on Georgia Tech.'s GitHub Enterprisegit@github.gatech.edu:ivabots/dynamixel.git+  - you are operating on a Ubuntu release with an appropriate distribution of ROS already installed
  
-**Note:** Walk-through instructions to set up and clone Git repositories can be found [[git:get_started here ]].+===== Install Dynamixel Motor Stack  ===== 
 +We will clone a repository forked from Anton Rebgun'[[ https://github.com/arebgun/dynamixel_motor dynamixel_motor ]] repository. The final version of ROS supported by this motor controller stack was ROS 1 kinetic (Python 2.7). Our lab-maintained fork of this repository has been updated to support ROS1 melodic and beyond (Python 3); ROS2 is **not supported** 
  
-===== Dynamixel Matlab API  ===== +If you haven't yet created a catkin workspace, open a terminal and run the following: 
-Within the repository, a 'Dynamixel_IO' Matlab class has been created to facilitate convenient communication and operation of the motors: code/matlab/Dynamixel_IO/Dynamixel_IO.m+<code
 +$ source /opt/ros/%ROS_DISTRO%/setup.bash 
 +$ mkdir -p ~/catkin_ws/src 
 +$ cd ~/catkin_ws/ 
 +$ catkin build 
 +</code> 
 +where '''%ROS_DISTRO%''' should be replaced with the ROS distribution installed on your system (e.g. melodic, noetic).
  
-Take some time to explore the class definition and high-level methods available+The following is derived from instructions found on the ROS.org page for the [[ http://wiki.ros.org/dynamixel_motor?distro=kinetic | Dynamixel motor stack ]]. It will clone the forked and lab-maintained repository into your catkin workspace: [[ https://github.com/ivaROS/ivaDynamixel | https://github.com/ivaROS/ivaDynamixel ]]. It presumes your catkin workspace is located per the instructions above:
  
-**Disclaimer**:  +<code> 
-  - The Dynamixel_IO Matlab class currently only supports Dynamixel motors using 10-bit encoders (ie. AX and RX line of motors). However, a variant (not yet committed to the repository) has been created to support most functions associated with motors using 12-bit encoders (eg. MX line of motors) and is available upon request.   +cd ~/catkin_ws/src 
-  - The Dynamixel_IO class relies on pre-compiled lower-level libraries to communicate with the motors. It presumes the libraries are located in a specific relative path. If you clone the 'dynamixel' repo and use the Dynamixel_IO class from the repository location, there should be no problemIf you move the Dynamixel_IO.m file out of the cloned repository location and use it elsewhere, however, it may not be able to find dependency libraries residing only in the repository+git clone https://github.com/ivaROS/ivaDynamixel.git 
-  - Pre-compiled libraries are available only for Linux (32- & 64-bit) and Windows (32- and 64-bit). Hence, this API does not currently support use on Mac OSX. Additionally, if run on Windows 64-bit, the user will be required to install a compiler that Matlab supports (eg. for running MEX files) +</code>
-  - This API will soon be updated to use Robotis' latest software interface. +
  
-===== Test Script and Exercise  ===== +===== ROS Dynamixel Motor Tutorial  ===== 
-Within the 'dynamixel' repo, navigate tocode/matlab/Dynamixel_IO/test_cases. +Follow this [[ http://wiki.ros.org/dynamixel_controllers/Tutorials | tutorial ]] for the ROS Dynamixel motor stack
- +
-Open and view the following test script which will command a motor, specified by the user, to a position (also specified by the user): test_case_command_single_motor.+
- +
-**Some notes**: +
-  - Find your port number: The red FTDI breakout board is connected to the PC via USB. On Linux, you should find a device file for it in '/dev'. Type ''ls /dev/ttyUSB*'' to see a list of device files that may correspond to this device. The number after 'ttyUSB' is your port number. Use that as the 1st argument to ''dxl.connect( ... );'' in the test script. +
-  - Motor ID: You will need to know the ID of the motor you'd like to command using this script. Enter that value in the line, ''motor_id = 17;'', replacing ''17'' with your motor's ID. +
-  - Command a position: In the line, ''dest_pos = pi/6;'', replace ''pi/6'' with a motor position (in radians) you'd like the motor to travel to. Remember, each line of motors has a set of specifications that document the minimum/maximum range of motion. +
-  - Run the script: Once you're done, hit the 'Play' button and follow any instructions in the prompt. If everything works out, you should see you motor move to the specified position. +
- +
-**Exercise(s)**:  +
-  - You have commanded a single motor to a single angular position. Can you now modify the Matlab script to command the motor to smoothly travel a sinusoidal trajectory (eg. with user-adjustable frequency, amplitude and phase offset) over time? Demonstrate this trajectory (with your choice of frequency, amplitude, phase, etc.) over 5 sine periods. +
-  - Now that you've commanded a time-varying trajectory for a single motor. Command 2 different trajectories for 2 motors! Make sure that both motors are following different sinusoidal trajectories - eg. they both can execute a sinusoidal trajectory over time, but each one should follow a sine wave defined by different parameters (eg. different frequency, amplitude and/or phase offset).+
  
 +It will guide you through useful tools to communicate with connected motors. A walk-through is additionally provided to configure a pan-tilt motor arrangement and program a ROS node to operate it.
  
 --------- ---------
 ;#; ;#;
-[[dynamixel:dynamixel:sw_prelim | Previous: Matlab Interface ]] -- [[: | Main ]] -- +[[dynamixel:sw_prelim | Previous: Matlab ]] -- [[dynamixel:main | Main (Dynamixel) ]]
 ;#; ;#;
dynamixel/ros.1538082641.txt.gz · Last modified: 2024/08/20 21:38 (external edit)