Difference between revisions of "MYRAbot's arm control (bioloid+arduino)"

From robotica.unileon.es
Jump to: navigation, search
(Creating a package for our programs)
(Creating a package for our programs)
Line 36: Line 36:
 
roscreate-pkg arduino_fer rosserial_arduino std_msgs</syntaxhighlight>
 
roscreate-pkg arduino_fer rosserial_arduino std_msgs</syntaxhighlight>
  
 +
We must change the content of the file "CMakeLists.txt" of our ''package'' for the next lines:
  
 +
<syntaxhighlight lang=cmake>cmake_minimum_required(VERSION 2.4.6)
 +
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
 +
 +
rosbuild_find_ros_package(rosserial_arduino)
 +
include(${rosserial_arduino_PACKAGE_PATH}/cmake_scripts/rosserial.cmake)</syntaxhighlight>
  
 
<!--
 
<!--
  
===Creación de un package para nuestros programas===
 
  
Deberemos tener previamente creado un [[Fernando-TFM-ROS02#Creando un espacio de trabajo|espacio de trabajo]] para nuestra versión de [http://www.ros.org ROS]. Para poder compilar y enviar nuestros programas a la placa [http://www.arduino.cc arduino] sin tener que pasar por [http://www.arduino.cc arduino] IDE vamos a crear un ''package'' llamado “arduino_fer” con las dependencias necesarias para nuestros programas, para ello ejecutaremos los siguientes comandos en un terminal:
 
 
<syntaxhighlight>cd ~/ros_workspace
 
roscreate-pkg arduino_fer rosserial_arduino std_msgs</syntaxhighlight>
 
     
 
Deberemos sustituir el contenido del fichero CmakeLists.txt, situado en la carpeta del ''package'' creado, por el siguiente:
 
 
<syntaxhighlight lang=cmake>cmake_minimum_required(VERSION 2.4.6)
 
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
 
  
 
rosbuild_find_ros_package(rosserial_arduino)
 
rosbuild_find_ros_package(rosserial_arduino)

Revision as of 16:05, 24 December 2013

< go back to main

Bioloid arm

The arm that we will use is that Carlos Rodríguez Hernández developed in the project MYRA Robot: Hardware Update . The main components are:

Photograph of Bioloid arm.
  • Arduino mega 2560 board.
  • 74LS241 chip (tree-state Buffer).
  • Voltage regulator circuit.
  • 5 serial servo motors Dynamixel AX-12A.
  • Mounting components of Bioloid kit.
  • Parts made for the gripper and to fix to MYRAbot.

Arduino IDE and rosserial

For the communication among arduino and ROS, we install arduino IDE and rosserial (package de ROS which include the package rosserial_arduino with the libraries for arduino. We will start to installing arduino IDE, for this, we will execute the next commands in a terminal:

sudo apt-get update
sudo apt-get install arduino arduino-core

When the installation of arduino software ends, we will install the ROS package. For this, we will execute the next command in a terminal:

sudo apt-get install ros-ROS_DISTRO-rosserial

When we will have installed arduino IDE and the stack rosserial, we must copy the libraries for the package rosserial_arduino to the sketchbook of arduino. For this, we will execute the next commands in a terminal:

roscd rosserial_arduino/libraries
cp -r ros_lib /home/”SESSION_NAME”/sketchbook/libraries/ros_lib

Creating a package for our programs

Previously, we must have created a workspace for our ROS distribution. We will create a package in order to compile and send our programs to arduino board. We will make a package named "arduino_fer" with the the necessary dependences for our programs, for this, we will execute the next commands in a terminal:

cd ~/ros_workspace
roscreate-pkg arduino_fer rosserial_arduino std_msgs

We must change the content of the file "CMakeLists.txt" of our package for the next lines:

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

rosbuild_find_ros_package(rosserial_arduino)
include(${rosserial_arduino_PACKAGE_PATH}/cmake_scripts/rosserial.cmake)


< go back to main