3 axis head system that can be controlled by a cell phone or a USB controller. This open-source project is part of the Robotics Engineering Project Course at the Université de Sherbrooke.
Useful links:
- http://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_workbench/#ros
- http://emanual.robotis.com/docs/en/parts/controller/opencr10/#install-on-linux
- https://github.com/GoldenCheetah/GoldenCheetah/wiki/Allowing-your-linux-userid-permission-to-use-your-usb-device
If you start from a clean Linux install, please do the following commands.
$ sudo apt-get update
$ sudo apt-get upgradeIn order to communicate with the OpenCR card via USB, the user has to be added to the correct group. This link shows all the details about this modification. But don't forget this part: Important: the computer needs to be restarted to have the modifications applied.
[user@machine ~]$ sudo usermod -a -G dialout userSee http://emanual.robotis.com/docs/en/parts/controller/opencr10/#install-on-linux for instructions to use the full and latest version of the Arduino IDE, not the one in the packages repository since it might be updated.
To be able to control the Dynamixel motors via ROS, the OpenCR card need to be converted in a USB to Serial device that will make the bridge between the ROS server (on Linux) and the motors connected with the OpenCR card.
After Arduino IDE is run, click File → Preferences in the top menu of the IDE. When the Preferences window appears, copy and paste the following link to the Additional Boards Manager URLs text box.
https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.jsonThen, click Tools → Board → Boards Manager. Type OpenCR into the text box to find the OpenCR by ROBOTIS package. When you find it, click Install. After the installation, “INSTALLED” will appear on your screen. See if the OpenCR Board is now on the list of Tools → Board. Click this to import the OpenCR Board source.
In order to the OpenCR card to make the bridge, please upload usb_to_dxl firmware (File -> Examples -> OpenCR -> 10.Etc -> usb_to_dxl) Then you can use /dev/ttyACM0 port (The number of the port may be different depending on setup).
In order to test the motors, please connect a SINGLE motor, connect the power supply and power on the card.
You can follow this link for the installation tutorial. The ROS utilization corresponds to the section 5 of the tutorial. Below are the condensed steps that need to be taken. Below are the simplified steps.
The following script will allow you to simplify the ROS installation procedure. Run the following command in a terminal window.
wget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_kinetic.sh && chmod 755 ./install_ros_kinetic.sh && bash ./install_ros_kinetic.shAfter install ROS, please reboot PC
Once ROS is installed, you'll need to change the directory to catkin_ws/src. It is where all the ROS package will be installed.
cd ~/catkin_ws/srcMain packages
git clone https://github.com/ROBOTIS-GIT/dynamixel-workbench.git
git clone https://github.com/ROBOTIS-GIT/dynamixel-workbench-msgs.gitDependant packages
git clone https://github.com/ROBOTIS-GIT/DynamixelSDK.git
git clone https://github.com/ROBOTIS-GIT/open_manipulator_msgs.git
sudo apt-get install ros-kinetic-moveit-core ros-kinetic-moveit-ros-planning ros-kinetic-moveit-ros-planning-interfaceInstall this package
Still in the catkin_ws/src/ folder, clone this project.
git clone https://github.com/gene2302/3-axis-ROS-sensor-head.gitOnce all the git has been cloned, different ROS packages will be installed too.
First, you'll need to source the correct ROS workspace in order to use ROS from anywhere. Then, make sure all dependencies are installed by using the rosdep tool. Finally, run catkin_make to build all the ROS workspace.
source /opt/ros/kinetic/setup.bash
cd ~/catkin_ws
sudo apt-get update
rosdep install --from-paths src --ignore-src -r -y
catkin_makeIf you are using a Raspberry Pi or a computer low on memory, you might need to limit the number of build threads jobs launched my catkin_make. By default, catkin_make launches one job (thread) per processor core. The -j 1 argument and value specifies to run one job. It will be slower, but will compile.
source /opt/ros/kinetic/setup.bash
cd ~/catkin_ws
sudo apt-get update
rosdep install --from-paths src --ignore-src -r -y
catkin_make -j 1In order to see which Dynamixel motors are connected, this command needs to be executed. Change ''ACM0'' to the port used by the OpenCR card.
rosrun dynamixel_workbench_controllers find_dynamixel /dev/ttyACM0WARNING: This package is intended for SINGLE Dynamixel. Please connect only One(1) Dynamixel to your device. If you connect multiple Dynamixels, manager would detect the lowest ID among connected Dynamixels. This package is to check Dynamixel status and access Dynamixel’s control table.
Important: In order to connect this node with the connect USB port, you shall modify the port in the configuration file located in the dynamixel_workbench_controllers config file. When using the sensor_head_gui package, the dynamixel_workbench_controllers configuration file does not need to be changed here, as it is supplied by the sensor_head_gui.launch file located in ROS/sensor_head_gui/launch/sensor_head_gui.launch
roslaunch dynamixel_workbench_single_manager single_manager.launchThis package is to check Dynamixel status and access Dynamixel’s Control Table addresses via GUI. WARNING: Before you run this package, please launch single_manager first.
rosrun dynamixel_workbench_single_manager_gui dynamixel_workbench_single_manager_gui
In order to use the package, please launch this launch file.
roslaunch sensor_head_gui base_launch.launch
This file will launch several ROS nodes (dynamical_workbench_controllers, sensor_head_gui). If you can't find the package, please see https://answers.ros.org/question/190317/ros-cant-find-package/
The arguments in this file, as well as the two .yaml configuration files in the ROS/sensor_head_gui/config/ folder, can be modified with other values if your setup is different.
Before the first run, a certificate must be created to be able to use a secured (https) website, required to use motion sensors on a mobile device. Create a SSL certificate by filling out the answers to the informations asked by the program, and make sure to use the exact name (address) that will be used at the FQDN or YOUR name question:
cd ~ && openssl req -new -x509 -keyout s4e4gro.pem -out s4e4gro.pem -days 365 -nodes
Using a https connection is required to use the orientation and motion javascript interfaces, or else they do not work, since it was deprecated. The certificate file is not included in the source control.
You can now open a browser to "https://localhost:4443" or replace localhost with the host's IP adress, or the computer's name if the full names are resolved. Adding the https is important.