Difference between revisions of "Little John Tutorials"

From Macro Wiki
Jump to: navigation, search
(Using a script)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Here you have some tutorials on how to run a simulation of the Little John robot using Rviz, the steps you need to use the physical robot, and a documentation of the classes we have in C++.
+
Here you have some tutorials on how to run a simulation of the Little John robot using [http://wiki.ros.org/rviz Rviz], the steps you need to use the physical robot, and a documentation of the classes we have in C++.
  
 
== How to use Rviz to simulate Little John ==
 
== How to use Rviz to simulate Little John ==
 +
 +
Before to run Rviz, make sure you have already installed and setup ROS, as well the needed libraries, besides DQRobotics and the Little John's repository. For more information, see the [[ROS Tutorial]].
  
 
=== Using a script ===
 
=== Using a script ===
Line 15: Line 17:
 
     ./<PATH/>simul_littlejohn.py --control <YOUR CONTROLLER NAME>
 
     ./<PATH/>simul_littlejohn.py --control <YOUR CONTROLLER NAME>
  
==== Example: ====
+
'''Example:'''
  
 
     ./simul_littlejohn.py -c wholeBodyControl
 
     ./simul_littlejohn.py -c wholeBodyControl
  
If you run the script without the "-c/--control", it will only open the Rviz with the Little John, but it will not perform any control action.
+
If you run the script without the '-c/--control', it will only open the Rviz with the Little John, but it will not perform any control action.
  
 
You can also use the '-h/--help' option in order to show the help of this script.
 
You can also use the '-h/--help' option in order to show the help of this script.
  
 
=== Manually ===
 
=== Manually ===
 +
 +
If you do not want to use the script described previously and prefer to run the command manually, you can follow the following steps:
 +
 +
1 - run 'roslaunch littlejohn_description littlejohn_simulator.launch';
 +
 +
2 - wait for Rviz to show the Little John in its window;
 +
 +
3 - from another terminal, run 'rosrun littlejohn_control <YOUR CONTROLLER>'.
  
 
== Steps to use the physical Little John ==
 
== Steps to use the physical Little John ==
  
 
In order to use Little John, one needs first to initialize the vision system that is responsible for obtaining the robot's pose. To do so, follow this steps:
 
In order to use Little John, one needs first to initialize the vision system that is responsible for obtaining the robot's pose. To do so, follow this steps:
 +
(Make sure you are connected to internet)
  
1- roslaunch markers markers_odometry.launch
+
1- run 'roslaunch freenect_launch freenect.launch';
  
2- rosrun rqt_reconfigure rqt_reconfigure
+
2- run 'rosrun rqt_reconfigure rqt_reconfigure';
  
3- Select ar_track_alvar and set max_frequency (29.87Hz).
+
3- select 'camera/driver' and set image_mode SXGA(1).
 +
 
 +
4- run 'roslaunch markers markers_odometry2.launch'
  
 
Now, follow the procedures to initialize the robot:
 
Now, follow the procedures to initialize the robot:
  
1- Connect the robotic arm into an outlet;
+
1- connect the robotic arm into an power outlet;
  
2- Connect the robotic arm to the computer through a USB port;
+
2- connect the robotic arm to the computer through a USB port;
  
3- sudo chmod 777 /dev/ttyUSB0
+
3- run 'sudo chmod 777 /dev/ttyUSB0';  (If you already have USB port permissions, ignore this step)
  
4- roslaunch my_dynamixel_tutorial ax18_controller.launch
+
4- run 'roslaunch my_dynamixel_tutorial ax18_controller.launch'; (You must be in this directory: '~/catkin_ws/'  and have previously executed: 'source devel/setup.bash')
  
5- Turn on the mobile base;
 
  
6- Connect the mobile base in the computer through a USB port;
+
5- turn on the mobile base;
  
7- sudo chmod 777 /dev/ttyUSB1
+
6- connect the mobile base in the computer through a USB port;
  
8- roslaunch turtlebot_bringup minimalmin.launch
+
7- run 'sudo chmod 777 /dev/ttyUSB1';
  
== Classes Brief Explanation and UML ==
+
8- run 'roslaunch turtlebot_bringup minimalmin.launch'.
 +
 
 +
== Classes brief explanation and UML ==
 
The C++ implementation of Little John is composed of the following classes:
 
The C++ implementation of Little John is composed of the following classes:
  
Line 65: Line 79:
  
 
[[File:little_john_uml.jpg|200px|thumb|center]]
 
[[File:little_john_uml.jpg|200px|thumb|center]]
 +
 +
== Additional resources ==
 +
[https://www.irobot.com/filelibrary/create/Create%20Manual_Final.pdf iRobot Create Manual]
  
 
== Doxygen documentation ==
 
== Doxygen documentation ==

Latest revision as of 19:09, 7 June 2018

Here you have some tutorials on how to run a simulation of the Little John robot using Rviz, the steps you need to use the physical robot, and a documentation of the classes we have in C++.

How to use Rviz to simulate Little John

Before to run Rviz, make sure you have already installed and setup ROS, as well the needed libraries, besides DQRobotics and the Little John's repository. For more information, see the ROS Tutorial.

Using a script

Today, in order to simulate the Little John using Rviz as a viewer, it is necessary to use two terminals: one to initialize Rviz and another one to starts the control of the robot. To avoid multiples terminals, you can use the Python script located in the Little John's repository:

   littlejohn/trunk/ROS/catkin_ws/src/scripts/simul_littlejohn.py

This script opens the Rviz and then execute the desired control. To run it, do

   ./<PATH/>simul_littlejohn.py -c <YOUR CONTROLLER NAME>

or

   ./<PATH/>simul_littlejohn.py --control <YOUR CONTROLLER NAME>

Example:

   ./simul_littlejohn.py -c wholeBodyControl

If you run the script without the '-c/--control', it will only open the Rviz with the Little John, but it will not perform any control action.

You can also use the '-h/--help' option in order to show the help of this script.

Manually

If you do not want to use the script described previously and prefer to run the command manually, you can follow the following steps:

1 - run 'roslaunch littlejohn_description littlejohn_simulator.launch';

2 - wait for Rviz to show the Little John in its window;

3 - from another terminal, run 'rosrun littlejohn_control <YOUR CONTROLLER>'.

Steps to use the physical Little John

In order to use Little John, one needs first to initialize the vision system that is responsible for obtaining the robot's pose. To do so, follow this steps: (Make sure you are connected to internet)

1- run 'roslaunch freenect_launch freenect.launch';

2- run 'rosrun rqt_reconfigure rqt_reconfigure';

3- select 'camera/driver' and set image_mode SXGA(1).

4- run 'roslaunch markers markers_odometry2.launch'

Now, follow the procedures to initialize the robot:

1- connect the robotic arm into an power outlet;

2- connect the robotic arm to the computer through a USB port;

3- run 'sudo chmod 777 /dev/ttyUSB0'; (If you already have USB port permissions, ignore this step)

4- run 'roslaunch my_dynamixel_tutorial ax18_controller.launch'; (You must be in this directory: '~/catkin_ws/' and have previously executed: 'source devel/setup.bash')


5- turn on the mobile base;

6- connect the mobile base in the computer through a USB port;

7- run 'sudo chmod 777 /dev/ttyUSB1';

8- run 'roslaunch turtlebot_bringup minimalmin.launch'.

Classes brief explanation and UML

The C++ implementation of Little John is composed of the following classes:

- LittleJohn: Class responsible for all the robot's communication (with the simulator and the real robot) and obtention of inter parameters (e.g., whole-body Jacobian matrix, end-effector pose, etc.). An object of this class is set to use in simulation or in real experiments through a parameter of the constructor.

- RoboticArm: Class responsible for the communication with the robotic arm.

- MobileBase: Class responsible for the communication with the mobile base.

The classes RoboticArm and MobileBase are meant to serve as intern attributes of the class LittleJohn and, therefore, their access occurs indirectly through an object of LittleJohn. This is made clearer in the UML that follows.

Little john uml.jpg

Additional resources

iRobot Create Manual

Doxygen documentation

Doxygen Little John

Examples

Nonlinear Control Simulation Example