domingo, 26 de septiembre de 2010

Stage

http://www.ros.org/wiki/stage

miércoles, 22 de septiembre de 2010

move_base_stage Tutorial

Following the tutorial of amazing ROS in: http://www.ros.org/wiki/move_base_stage/Tutorials/stage%20and%20navigation%20stack

...

Well trying the tutorial everything went fine until I followed the step #5. At the last command I recieved an error message like this:



So I went to the .cc code and found the part of the code where that error message was generated:



I coulnd't find where actually the error was, so I decided to change the !=4 to !=3 and see what happens...

After making stage I ran the willow.world once again...

It didn't work, I changed the values first and then the message and it didn't change, I also rosmake stage and nothing... It seems to bee usign another code, because in all the extension of the model.cc there is no other message like that, I also might be reading a copy of that code in another part... so I will follow all the instructions again and see if it works well...
---
roscp is a useful commandline tool for copying files from one package to another.
pr2 throws a robot on map =D

------
map_server
Provides the map_server ROS Node, which offers map data as a ROS Service. It also provides the map_saver command-line utility, which allows dynamically generated maps to be saved to file.
Maps manipulated by the the tools in this package are stored in a pair of files. The YAML file describes the map meta-data, and names the image file. The image file encodes the occupancy data.

http://www.ros.org/wiki/map_server
----

Other resources:

Navigator Stack and Stage:
Simple tutorial that sets up navigation stack and rosstage. Can be used by any new beginner just to see how awesome and simple ROS is

miércoles, 8 de septiembre de 2010

To test navigation stack with both robots.

After the new actualization of the "To simulate two robots" ticket I need to run two robots in two maps. The commands I need to follow are these:

$ roscd simulator_stage
$ svn co `roslocate svn navigation_stage`
$ roslaunch navigation_stage move_base_multi_robot.launch

First of all I will check how does the twoRobots world run.

I think the problem might be around here:
oscar@oscar-laptop:/opt/ros/cturtle/stacks/sscrovers-ros-pkg$ rostopic echo robot_footprint

WARNING: topic [/robot_footprint] does not appear to be published yet

Because robot_footprint

robot_footprint (geometry_msgs/Polygon)

* Polygonal "footprint" around the robot. Rendered as a line.

I don't see any robot nor form on the map, and I should see it even in a corner of it.



I decided to try another example, in this case one using the same fake_localization node. I tried the move_base_fake_localization_10cm.launch example. But I had the the same problem. Then I decided to echo the different topics and see their messages, and I saw that many topics didn't publish anything, and the /odom topic published origin values.

After trying many ways to find the issue I decided to write a letter to the ROS community as follows:

HI everybody,

Im trying to run the launch/move_base_multi_robot.launch example launch file, it simulates two robots on different windows. But when the windows of nav_view opens I don't see anything but the map (image 1). Neither the inflated obstacles nor the particle cloud or the robot footprint seem to appear. I also looked for information in what was being published over those topics but there weren't any messages. I also receive a warning message when I run the launch file but I don't know if it has anything to do with it (Image 2):

[ WARN] [1285694547.646811796, 3.800000000]: The base_scan observation buffer has not been updated for 2.10 seconds, and it should be updated every 0.40 seconds.

This problem occurs also with the move_base_fake_localization_10cm.launch example, but in this case it opens a window from stage (Stage-3.2.2) and from there I can see the footprint of the robot (image 3). Also when I listen to the /odom topic (rostopic echo /odom) It prints the following (image 4):

wist:
twist:
linear:
x: 0.0
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.0
covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

Could you please tell me the possible reason of why I cant see the footprints of the robot or anything else besides the map on the nav_view window?

The Version of Ubuntu I use is 10.4
The Version of ROS is CTurtle.
The Version of Stage is 3.2.2.

Image 1:


Image 2:


Image 3:


Image 4:


........
Chatting with Renato:

We saw that a a part of the launch file code is responsible of why in the multi robot example we don't see any stage map. When the stage node is declared there is a part where...

and if you delete it you can see now the stage map.

Actually when you set the goal on the nav_view map, the respective robot starts to move.

-----

Finally I could solve the problem by editing the rgb.txt file. Now both maps have their respective robots, and no important error seems to make problems on the simulation.

--
Oscar Rodrigo Hernández Panczenko IMT

Resources:

.pgm format: http://netpbm.sourceforge.net/doc/pgm.html

To see an image in terminal go to the directory where that image is and cast oeg:
http://netpbm.sourceforge.net/doc/pgm.html

------------------------------------
To see images cast eog "file"
To see pdf files cast xpdf "file"
------------------------------------
/rosout (roslib/Log)

* Standard ROS topic for publishing logging messages.
---------------------------------------
/clock Topic

Nodes are automatically subscribed to the /clock Topic, which is a global Topic published by a Clock Server. The Clock Server publishes regular time Messages (at an unspecified rate).
-------------------------------------
nav_view
Is a GUI for visualizing 2-D navigation. It is a specialized interface for the navigation stack.

nav_view displays:

* A map
* A robot's pose
* A cloud of particles (e.g., from a localization system)
* Two paths (e.g., from a path planner)
* A set of obstacles (and inflated obstacles)

http://www.ros.org/wiki/nav_view

--------------------------------------
fake_localization:

The fake_localization package provides a single node, fake_localization, which substitutes for a localization system, providing a subset of the ROS API used by amcl. This node is most frequently used during simulation as a method to provide perfect localization in a computationally inexpensive manner.

Specifically, fake_localization converts odometry data into pose, particle cloud, and transform data of the form published by amcl.

--------------------------------------
amcl:

amcl is a probabilistic localization system for a robot moving in 2D. It implements the adaptive (or KLD-sampling) Monte Carlo localization approach (as described by Dieter Fox), which uses a particle filter to track the pose of a robot against a known map.

http://www.ros.org/wiki/amcl

--------------------------------------

map_server

map_server provides the map_server ROS Node, which offers map data as a ROS Service. It also provides the map_saver command-line utility, which allows dynamically generated maps to be saved to file.

http://www.ros.org/wiki/map_server

--------------------------------------

cmd_vel:

cmd_vel geometry_msgs/Twist

* velocity commands to differentially drive the position model of the robot

http://www.ros.org/wiki/stage

--------------------------------------
navigation_stage

This package holds example launch files for running the ROS navigation stack in stage.

http://www.ros.org/wiki/navigation_stage

--------------------------------------
Information about some topics involved:

miércoles, 18 de agosto de 2010

Testing the Sick Laser

1) First I created a directory called:

~/Player_Stage/Laser_Test

Then I created there a file named sick.cfg (This idea was taked from Laura's Blogg).

The content of that file must be:

driver
(
name "sicklms200"
provides ["laser:0"]
port "/dev/ttyUSB1")

Then, after saving it you must execute these commands:
$ robot-player sick.cfg
$ robot-playerv

Then you are supposed to see the scan when you subscribe to the laser sick lms 200.
...
But following these steps I couldn't get the lecture of the laser, instead I got this error:

oscar@oscar-laptop:~/Player_Stage/Laser_Test$ robot-playerv
PlayerViewer 2.0.4
Connecting to [localhost:6665]
calling connect
done
Available devices: localhost:6665
laser:0 sicklms200 ready
playerc error : timed out waiting for server reply to request 6:0:3:1
playerv : error in dev_laser.c
libplayerc error: timed out waiting for server reply to request 6:0:3:1


Then reading about the ports I accessed the /dev directory and looked up for the ttyUSB0 port, but I could not fin it. The ports I found that I think may be the usb ports are these:

usbmon0
usbmon1
usbmon2



...

Reading about usbmon on the web I got these info:

"3 The name "usbmon" in lowercase refers to a facility in kernel which is
4 used to collect traces of I/O on the USB bus. This function is analogous
5 to a packet socket used by network monitoring tools such as tcpdump(1)
6 or Ethereal. Similarly, it is expected that a tool such as usbdump or
7 USBMon (with uppercase letters) is used to examine raw traces produced
8 by usbmon.
9
10 The usbmon reports requests made by peripheral-specific drivers to Host
11 Controller Drivers (HCD). So, if HCD is buggy, the traces reported by
12 usbmon may not correspond to bus transactions precisely. This is the same
13 situation as with tcpdump.


So I need the ports ttyUSB0 and ttyUSB1.

Reading on Linux Forums I found this post, and it maybe the main reason of why I don't see the port on /dev:


"I don't know what exactly your device is. But my Palm use ttyUSB0 to sync with Ubuntu. The /dev directory is managed by udev, so every device file is created dynamically. What I see on my system is: when I connect my Palm to the usb port and push the sync button on Palm, the /dev/ttyUSB0 will be created on the fly. And after the sync is over, the /dev/ttyUSB0 gone too. So you might not see the /dev/ttyUSB0 device file if your device is not activated."


The next step is to try again the teleoperation of the Pioneer and see if the ttyUSB0 port is created at that instant.

...

It doesn't work, I get the next error:

ROSARIA/bin$ ./RosAria
[ INFO] [1282178888.412720880]: using serial port: [/dev/ttyUSB0]
ArLog::init: Could not open file aria.log for logging.
Could not connect to simulator, connecting to robot through serial port /dev/ttyUSB0.
ArSerialConnection::open: Could not open serial port '/dev/ttyUSB0'
Could not connect, because open on the device connection failed.
Failed to connect to robot.
rotate: Could not connect to robot! Exiting.
setup failed...

I don't have any idea of why ttyUSB0 doesn't appear. I will continue tomorrow.
------------------------------------------------------------------------------------

Testing the Laser With Aria.

First change the port from COM3 to ttyUSB0 (It depends in where you want to listen the Laser) in line 110 of p3dx.p in .../Aria/Aria/params

Starting with p2os

1) Install p2os following the p2os Getting Started Tutorial

2) Then I Tested the communication with the robot using RosAria.

First I Changed the usb port from port 1 to port 0. To do this you need to go to the ROASRIA package.

$ roscd ROSARIA
$ cd src

Then edit the RosAria.cpp file.

$ sudo gedit RosAria.cpp

and edit the line 80:

n.param( "port", serial_port, std::string("/dev/ttyUSB1") );


to

n.param( "port", serial_port, std::string("/dev/ttyUSB0") );


Make the package and then move to ROSARIA/bin

Then run a Core

$ roscore

Turn on the Pioneer, connect the usb-serial cable and run RosAria

./RosAria.

Finally you should see something like this:


Retrieving information about robot's odometry.

You can also consult my other post to see the next steps about how to control the robot with the keyboard:

Controling Pioneer

2.1) Using the Keyboard to contorl de Pioneer.

Following the instructions of my other post I culnd't teleoperate the robot. I think is is because the latest relese of the svn of teleop_base publishes on a topic named /cmd_vel instead of /RosAria/cmd_vel. So now i'm modifying the RosAria.cpp file so it listens /RosAria/cmd_vel topic.

Note: It is localized in ROSARIA/src and the code i'm modifying is in the line 95 from this:

cmdvel_sub = n.subscribe( "/cmd_vel", 1, (boost::function < void(const geometry_msgs::TwistConstPtr&)>)

To this:

cmdvel_sub = n.subscribe( "/RosAria/cmd_vel", 1, (boost::function < void(const geometry_msgs::TwistConstPtr&)>)

Well Now the robot moves, but there's a little problem with RosAria, because it suddenly stops and the communication with the robot freezes. It stop updating the info...

[ INFO] [1282152720.503071698]: /odom: 1282152720.503030 0.000000 0.000000

It stops there. I will search for the problem later, now I will focus on the next task.

3)

viernes, 13 de agosto de 2010

Simulating two robots in ROS

Following the instructions published in assembla I got the following results:

1.- First I created the file: twoRobots.launch in the directory:
/opt/ros/cturtle/stacks/simulator_stage/stage/world



And then I updated the file tworobots.launch located in:
/opt/ros/cturtle/stacks/sscrovers-ros-pkg/launch


2.- Run de launch file: roslaunch launch/tworobots.launch


Now we can see the two robots on the map.

3.- Control the robots with the keyboard launching the tworobots2.launch file.

To control one robot I only need to use the keyboard while the terminal running tworobots.launch is in front of the other windows. To control de second robot I need to do the same thing but with the terminal running tworobots2.launch



Test Navigation Stack with both robots.

Here we can see the nodes teleop_base1 and teleop_base2, as well as the topics of cmd_vel for robot0 and robot1.



The odometry of both robots is done separately, in this case we can't see the lasers of the robots on the map because of the version of ROS and the Ubuntu Release that I have. I really don't know why that problem exists but I hope I will know how to solve it soon.

Regards.

miércoles, 11 de agosto de 2010

ROSDEP

This is a little post of how to use rosdep.

Use rosdep and rosmake to build any package in the ROS repository.

"Say that you want to build a package called AMAZING_PACKAGE, that you hadn't built on your machine before."

rosdep install AMAZING_PACKAGE


"What's happening under the hood"

1. rosdep uses rosmake to find all system dependencies recursively
2. rosdep looks up how to resolve the system dependencies for the OS running using the rosdep.yaml files.
3. rosdep tries to detect what is installed on your system already
4. rosdep generates a bash script to install all missing system dependencies
5. rosdep executes the bash script

To view the bash script before executing run


rosdep satisfy AMAZING_PACKAGE

Understanding how tf is generated

First of all consult this Tutorial: Introduction to tf

Here you can see how to use these basic tf tools:

> view_frames: creates a diagram of the frames being broadcast by tf over ROS.

$ rosrun tf view_frames

Here a tf listener is listening to the frames that are being broadcast over ROS and drawing a tree of how the frames are connected. To view the tree:

$ evince frames.pdf


This is an example of the tf tree of the activity of the first ticket of Assembla in the projecto of SSC-ITESM.

If you know the frames involved, you can ask tf_echo to report the transform between any two frames broadcast over ROS.

Usage:

rosrun tf tf_echo [reference_frame] [target_frame]

"Let's look at the transform of the turtle2 frame with respect to turtle1 frame which is equivalent to \large{$$\mathbf{T}_{turtle1\_turtle2} =\mathbf{T}_{turtle1\_world} *\mathbf{T}_{world\_turtle2}$$} :

$ rosrun tf tf_echo turtle1 turtle2

------

Next I read this Tutorial "Leraning tf" all in cpp: Learning tf

1) Writing a tf broadcaster (C++):

martes, 10 de agosto de 2010

Functionality of the topics used in do-slam-navigation.launch

1) Run do-slam-navigation.launch

roslaunch launch/do-slam-navigation.launch

2) In a new terminal run rxgraph.

The nodes involved when launching do-slam-navigation.launch are the following:

/amcl
/Gmapping
/move_base_node
/Stage_Sim
/Teleop_Base
/TF_Broadcaster
/rosout

We can see how nodes communicate each other by messages through topics with the following diagram (rxgraph):



3) We can see using rxgraph to wich topic each node sobscribes or publishes. Fow example if we click on the node /Stage_Sim we get this info:

Node [/Stage_Sim]
Publications:
* /base_scan [sensor_msgs/LaserScan]
* /rosout [roslib/Log]
* /tf [tf/tfMessage]
* /clock [roslib/Clock]
* /odom [nav_msgs/Odometry]
* /base_pose_ground_truth [nav_msgs/Odometry]

Subscriptions:
* /clock [roslib/Clock]
* /cmd_vel [geometry_msgs/Twist]

Services:
* /Stage_Sim/set_logger_level
* /Stage_Sim/get_loggers
Pid: 14092
Connections:
* topic: /rosout
* to: /rosout
* direction: outbound
* transport: TCPROS
* topic: /tf
* to: /Gmapping
* direction: outbound
* transport: TCPROS
* topic: /tf
* to: /move_base_node
* direction: outbound
* transport: TCPROS
* topic: /tf
* to: /amcl
* direction: outbound
* transport: TCPROS
* topic: /base_scan
* to: /move_base_node
* direction: outbound
* transport: TCPROS
* topic: /clock
* to: /Stage_Sim
* direction: outbound
* transport: INTRAPROCESS
* topic: /clock
* to: /Gmapping
* direction: outbound
* transport: TCPROS
* topic: /clock
* to: /TF_Broadcaster
* direction: outbound
* transport: TCPROS
* topic: /clock
* to: /move_base_node
* direction: outbound
* transport: TCPROS
* topic: /clock
* to: /amcl
* direction: outbound
* transport: TCPROS
* topic: /clock
* to: /Teleop_Base
* direction: outbound
* transport: TCPROS
* topic: /clock
* to: http://oscar-laptop:56712/
* direction: inbound
* transport: INTRAPROCESS
* topic: /cmd_vel
* to: http://oscar-laptop:45548/
* direction: inbound
* transport: TCPROS
* topic: /cmd_vel
* to: http://oscar-laptop:58957/
* direction: inbound
* transport: TCPROS


Then we can see that it publishes in these topics:

* /base_scan [sensor_msgs/LaserScan]
* /rosout [roslib/Log]
* /tf [tf/tfMessage]
* /clock [roslib/Clock]
* /odom [nav_msgs/Odometry]
* /base_pose_ground_truth [nav_msgs/Odometry]

And subscribes to these other topics:
* /clock [roslib/Clock]
* /cmd_vel [geometry_msgs/Twist]

-----

As seen on the rxgraph the topics involved are:

/clock "It is used to published simulated time within a runtime system."
/tf "Current transform tree. This is the normal /tf topic."
/map "Get the map data from this topic, which is latched, and updated periodically."
/cmd_vel "velocity commands to differentially drive the position of the robot."
/rosout "Standard ROS topic for publishing logging messages."
/base_scan

lunes, 9 de agosto de 2010

How to know to wich topic a node subscribes or publishes

We can know to wich topic a node subscribes or publishes by viewing carefully the .cpp file of the node. Along the code you can find the name of the topic to which the node subscribes or publish, for example:

ros::Publisher chatter_pub = n.advertise<std_msgs::String>("chatter", 1000);

In this line you can see that the node publishes to the "chatter" topic, and that the message is of the type of std_msgs/String

ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);

In this other example you can see that the node subscribes to the "chatter" topic.

For more information: Writing a Simple Publisher and Subscriber (C++)

Launch File Configuration - Tag Reference

The launch file is an XML code that describes how the nodes of a package are configured. It consists of the following tags (Not all of them are always necessary):

<launch>
It is used as a container of the other tags. It is the root element of any roslaunch file. As any XML file it starts with and ends with . In this case this tag is always at the beginning and the end of every launch file.

<node>
The node tag specifies a node that you want to have launched. It brings up and takes down nodes.

Note: "roslaunch does not provide any guarantees about what order nodes start in. This is intentional: there is no way to externally know when a node is fully initialized, so all code that is launched must be robust to launching in any order"


<machine>
This tag declares a machine that runs ROS nodes on. "It is mainly used to declare SSH and ROS environment variable settings for remote machines".

Attributes:
name, address, ros-root, ros-package-path, default, user, password and timeout.

It's only Element is: env.

More info about this tag in:
Note: "You do not need this tag if you are launching all the nodes locally"

<include>
This tag allows you to include another roslaunch file into your current file.

Attributes: file, ns, clear_params.

More info about this tag in: <include>

<remap>
"The tag allows you to pass in name remapping arguments to the ROS node that you are launching in a more structured manner than setting the args attribute of a directly"

Attributes:
from, to.

More info about this tag in:

<env>
This tag allows you to set environment variables on nodes that are launched in the XML file.

Attributes:
name, value.

More info about this tag in:

<param>
Instead of a value you can specify a textfile or binfile attribute to set the value of a parameter to be set on the Parameter Server.

Attributes:
name, value, type, textfile, binfile, command.

More info about this tag in:

<rosparam>
"The tag enables the use of rosparam YAML files for loading and dumping parameters from the ROS Parameter Server. It can also be used to remove parameters."

Attributes:
command, file, param and ns.

More info about this tag in:

Note: The attribute ns is deprecated.

<group>
With this tag you can apply settings to a defined group of nodes.

Attributes:
ns, clear_params.

More info about this tag in:

<test>
This node is like a tag, but the difference is that it refers to a test node.

More info about this tag in:

<arg>
"The tag allows you to create more re-usable and configurable launch files by specifying values that are passed via the command-line, passing in via an , or declared for higher-level files."

More info about this tag in:

---

Key Concepts:

Parameter Server: "A parameter server is a shared, multi-variate dictionary that is accessible via network APIs. Nodes use this server to store and retrieve parameters at runtime. As it is not designed for high-performance, it is best used for static, non-binary data such as configuration parameters. It is meant to be globally viewable so that tools can easily inspect the configuration state of the system and modify if necessary. "

---

More information available at: ROSLAUNCH/XML
The examples showed in this post are from the same link.

Also if you need to learn XML you can use this free tutorial: XML Tutorial

rviz Main Configuration Elements

rviz

This is how the dashboard looks:



It's main components are:

Displays:
This are the different options to visualize the information obtained from the laser, the sonar, the camera, the encoders etc. any sensor that ROS can read. Also we can display different marks or grids to make ouy visualization easier.

These are some of the displays we can activate:

Axes, camera, grid, grid cells, laser scan, map, markers, path, pose, pose array, point cloud, polygon, odometry, robot model, tf.

They are fully explain on the USER'S GUIDE



Coordinate frames: rviz uses tf transform system to for transforming data from the coordinate frame it arrives into a global reference frame.





Tools:
> Move Camera
> Select parts of the 3D Robot



> Navigation Goal
> Estimate the 2D pose

Tool properties:



Time: "It allows you to see how much ROS Time time has passed, vs. how much "Wall Clock" (aka real) time has passed."



Plugins: Thera are some plugins that can be added to rviz. They can be installed in the plugins->manage.

This info is taked from the User's guide or ROS.org in:
rviz USER GUIDE

Yaw, Pitch and Roll

tf view_frames and tf_echo

These are two of the basic tools to use:

> view_frames: This tool creates a diagram of frames that are being broadcast by tf over ROS.

$ rosrun tf view_frames

It draws a tree of how the frames are connected, to see it use the next command:

$ evince frames.pdf

> tf_echo

tf_echo reports a transform between two frames broadcast over ROS. To use it you need to specify both frames in the command line.

like this:

rosrun tf tf_echo [reference_frame] [target_frame]

miércoles, 28 de julio de 2010

Installing and running rviz

Following the instructions of the tutorial:

http://www.ros.org/wiki/rviz/UserGuide

1.-Installing rviz:

$ rosdep install rviz

When I tried to install rviz I got the next answer:

oscar@oscar-MAC:~/ros/ros$ rosdep install rviz
executing this script:
set -o errexit
#No Packages to install

As I couldn't install it I decided to look if I allready had it, so I tried to run it:

oscar@oscar-MAC:~/ros/ros$ rosrun rviz rviz
[rosrun] Couldn't find executable named rviz below /home/oscar/ros/stacks/visualization/rviz
[rosrun] Found the following, but they're either not files,
[rosrun] or not executable:
[rosrun] /home/oscar/ros/stacks/visualization/rviz
[rosrun] /home/oscar/ros/stacks/visualization/rviz/src/rviz

When I've got that answer I looked up on that directory (/home/oscar/ros/stacks/visualization/rviz) and then I compiled it:

oscar@oscar-MAC:~/ros/stacks/visualization/rviz$ rosmake

It compiled without problems but when I tried to run rviz it showed me the next message:

oscar@oscar-MAC:~/ros/stacks/visualization/rviz$ rosrun rviz rviz
[ERROR] 1280354462.238279000: [registerPublisher] Failed to contact master at [localhost:11311]. Retrying...
^C[ INFO] 1280354464.400475000: Loading general config from [/home/oscar/.rviz/config]
[ INFO] 1280354464.403360000: Loading display config from [/home/oscar/.rviz/display_config]
[rospack] warning: trailing slash found in ROS_PACKAGE_PATH
[ INFO] 1280354465.258272000: Saving general config to [/home/oscar/.rviz/config]
[ INFO] 1280354465.259305000: Saving display config to [/home/oscar/.rviz/display_config]

mmm it seems that I need to run roscore to fix the problem... well yes I runed roscore and in a new terminal I runed rviz and worked normaly XD.




Now let's learn all the features of rviz!!

Next goal-> Learn the tf node.

lunes, 26 de julio de 2010

Installing Cturtle

The installation of Cturtle is almost the same process of installing boxturtle, you even have to follow the same instructions of the boxturtle installation tutorial, the only thing you need to change is "boxturtle" for "cturtle" in each command line. The tutorial is located in this web page:

http://www.ros.org/wiki/ROS/Installation/Ubuntu/SVN

Instalación Cturtle

Ahora resulta que siempre si apareciero el archivos setup.sh en su directorio y ya funciona roscore así como las diferentes fuciones. Ahora procederé a instalar Cturtle.

Seguí el tutorial de instalación y únicamente modifiqué boxturtle por cturtle en el comando de instalación, no presentó ningun problema evidente.

A partir de la siguiente publicación comencaré a redactar los avances en inglés.

viernes, 23 de julio de 2010

Instalando Player-Stage

Bueno pues al parecer ya instalé el player stage con el synaptics para probar el laser y esas cosas, ahora falta solucionar el problema con ROS para continuar.

Aprendiendo Python

Ok ya terminé el curso básico sobre XML y por fin entiendo muchas cosas que no entendía antes sobre los docs de ROS en .xml. Ahora voy a proseguir con el aprendizaje de python, para esto encontré páginas, videos, tutoriales y cookbooks muy interesantes, entre los principales tengo los siguientes:

Tutorial en youtube te Python para utilizarlo en windows 7, lo importante es el aprender a programar mas alla de en que SO se utilice:

http://www.youtube.com/watch?v=4Mf0h3HphEA

Pytoh.org Es una página en donde encuentras todo lo que necesitas sobre python:

http://www.python.org/

Tutorial de como utilizar Python en Ubuntu:

http://www.onecore.net/how-topython-programming-under-ubuntu.htm

Cookbook de Python:

http://code.activestate.com/recipes/langs/python/

Tutorial escrito de python:

http://www.dickbaldwin.com/tocpyth.htm

Aprendiendo XML

Mientras se descargaban los paquetes faltantes con el synaptic, me puse a estudiar un poco más sobre XML y me di cuenta de un dato importante:

Entity References

Some characters have a special meaning in XML.

If you place a character like "<" inside an XML element, it will generate an error because the parser interprets it as the start of a new element.

This will generate an XML error:
if salary < 1000 then

To avoid this error, replace the "<" character with an entity reference:
if salary < 1000 then

There are 5 predefined entity references in XML:
< < less than
> > greater than
& & ampersand
' ' apostrophe
" " quotation mark

Note: Only the characters "<" and "&" are strictly illegal in XML. The greater than character is legal, but it is a good habit to replace it.

Nota: La metadata es la data que habla sobre otra data >.<

Respuesta de Renato

La respuesta de Renato sobre el problema presentado fue:

"Hola Oscar,

La version de ROS que utilizas es la del SVN? Yo creo que seria mejor que utilizaras la Cturtle. Esta version ya sea en Karmic o Lucid teoricamente no tienes que compilar el sicktoolbox_wrapper.

El problema que tienes al parecer es porque tu sistema de librerias tiene dependecias inestables. Entonces tienes que hacerlo estable. Intenta utilizando el Synaptic buscando los broken packages y luego haciendo un apt-get update y apt-get upgrade. Puede que eso lo arregle, sino cambiandote a Lucid seguro se arregla.

En caso que no, manda tu pregunta a los mailing lists y ahi algun expert te contestara apropiadamente.

Saludos,

Renato."


Entonces ahorita trataré solucionar el problema de las dependencias y posteriormente veré si puedo actualizar la versión de ROS a la de Cturtle.

----

Ok ya instale los paquetes que faltaban pero al parecer esto hizo que varios archivos originales de ros fueran eliminados, ahora ya no puedo utilizar funciones de ros ni correr roscore, vere si puedo arreglarlo, si no es así procedo a instalar ROS con Cturtle.

mmm no, incluso el setup.sh fue borrado:

bash: /opt/ros/boxturtle/setup.sh: No such file or directory
bash: /opt/ros/boxturtle/ros/tools/rosbash/rosbash: No such file or directory
oscar@oscar-MAC:~$ roscore
roscore: command not found

Esas líneas aparecieron al abrir la terminal. Procederé a descargar e instalar el Cturtle.

1.- Entré a la siguiente URL para descargarlo del SVN:

http://www.ros.org/wiki/ROS/Installation/Ubuntu/SVN

mmmm el problema es que desde ahí únicamente puedo descargar el boxturtle..

Encontré esta otra URL en donde dicen que para instalar Cturtle (o mas bien reemplazar Cturtle por boxturtle solo tienes que seguir las mismas instrucciones y reemplazar tdo lo que diga "boxturtle" por "cturtle".

http://www.ros.org/news/2010/06/ros-c-turtle-alpha-1-released.html (Sí tenía que ser la URL del primer release "Alpha 1" Duh.)

Bueno antes de continuar decidí hacerle un update a ROS con el siguiente comando:

~/rosinstall ~/ros http://ros.org/rosinstalls/boxturtle_base.rosinstall

A pesar de reinstalarlo no pude utilizar roscore ni roscd. Le escribiré un correo a Renato para ver el problema.

Mientras sigo con las clases de Stanford. Ya acabé el tutorial básico de XML, seguiré con el de c++ avanzado y empezaré el de python. Laura está empezando a escribir sus avances en su propio blog, le pediré acceso para estar al tanto de sus avances y le dare el mio para aprender de nuestras experiencias.

miércoles, 21 de julio de 2010

Problemas con el package sicktoolbox_wrapper

Bueno pues al parecer tengo un problema al momento de instalar el sicktoolbox_wrapper , me sale el siguiente error:

oscar@oscar-MAC:~$ rosdep install sicktoolbox_wrapper rviz

executing this script:
set -o errexit
#Packages
sudo apt-get install libboost1.40-all-dev
[sudo] password for oscar:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libboost1.40-all-dev: Depends: libboost1.40-dev but it is not going to be installed
Depends: libboost-date-time1.40-dev but it is not going to be installed
Depends: libboost-filesystem1.40-dev but it is not going to be installed
Depends: libboost-graph1.40-dev but it is not going to be installed
Depends: libboost-iostreams1.40-dev but it is not going to be installed
Depends: libboost-math1.40-dev but it is not going to be installed
Depends: libboost-program-options1.40-dev but it is not going to be installed
Depends: libboost-python1.40-dev but it is not going to be installed
Depends: libboost-regex1.40-dev but it is not going to be installed
Depends: libboost-serialization1.40-dev but it is not going to be installed
Depends: libboost-signals1.40-dev but it is not going to be installed
Depends: libboost-system1.40-dev but it is not going to be installed
Depends: libboost-test1.40-dev but it is not going to be installed
Depends: libboost-thread1.40-dev but it is not going to be installed
Depends: libboost-wave1.40-dev but it is not going to be installed
E: Broken packages


La verdad no se bien a que se deba ese error pero creo que es posible a que desde el momento en el cual hice el upgrade del SO de koala a lucid, me dice que teiene problemas en identificar los drivers adecuados para las graficas, de hecho al principio me salia un cuadro de con opciones de como iniciar ubuntu, si de forma segura o no etc, debido a problemas que no supe al final cuales son. Me comenta Laura que puede ser debido al upgrade que hice, que ella instalo directamente lucid desde un CD. Le escribi un correo a Renato para ver que se puede hacer para solucionar esto, en caso de que sea debido al upgrade lo mas seguro es que formatee esta máquina virtual, ya que hacer un downgrade es muy riesgoso y dificil.

Ahora bien mientras tanto revise en google para que sirven los .yaml y al parecer son documentos en un lenguaje de alto nivel que sirven para muchas cosas entre las cuales la que mas me sirve es la de guardar valores a parametros o variables que utilicen programas por ejemplo programados en .xml

Así mismo lei un poco sobre el paquete de rviz y por fin entendi un poco mas que es y como funciona.

Ahora temrinaré mi tutorial sobre HTML para proseguir con el de XML, veré un par de clases de Stanford y mañana haré el tutorial que me pasó Laura de how amazing ROS is. A ver que me contesta Renato.

Por cierto el link sobre el curso de HTML. XML, JAVA etc es: http://www.w3schools.com/html/default.asp

Puede ser de ayuda a muchos compañeros ;)

Nota interesante:

XML was designed to transport and store data.

HTML was designed to display data.

viernes, 16 de julio de 2010

Videoconferencia con Renato y control del Pioneer 2.0

Bueno pues hoy Laura y yo tuvimos una video conferencia con Renato en donde nos resolvió algunas dudas y nos dejo tarea (Los links suministrados los pego abajo).

Las tareas consisten en lo siguiente:
-Ver los videos de introducción a la robótica de Stanford mas que nada para entender mas a fondo los coneptos generales de un robot.
-Intentar generar un mapa con el laser del robot.

Bueno, pues parte de la conversación fue acerca de que ya cambió el package de sscrovers-ros-pkg en cuanto que ya no tiene el nodo de visión que generaba tantos problemas para compilar, así que estoy procediendo a borrar el directorio de sscrovers-ros-pkg para volverlo a descargar y compilar.

Para hacer esto tienes que poner sudo su para accesar como ROOT ya que si no, no te permite hacer casi nada y posteriormente escribir rm -f -r y listo.

Adjunto un link que explica este comando:

http://en.wikipedia.org/wiki/Rm_%28Unix%29

mmm ok siguiendo las instrucciones del tutorial:

Build a Map in Stage: http://www.assembla.com/wiki/show/ssc-rovers/Starting_with_ROS

Descargué nuevamente el package y lo pude compilar sin mayor problema.

Ahora es momento de ver si ROSARIA funciona y puedo controlar al robot.

Lo primero es conectar el cable serial al robot, posteriormente (aun como root) me dirigí al siguiente directorio:

root@oscar-MAC:/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_odometry/ROSARIA/bin#

entonces ejecuté ROSARIA con el siguiente comando (con ls vez los ejecutables en verde):

./RosAria

inmediatamente empieza a surgir una respuesta en pantalla mas o menos así:

[ INFO] 1279298645.478370000: rcv: 1279298645.478318 0.000000 0.000000
[ INFO] 1279298645.687279000: rcv: 1279298645.687230 0.000000 0.000000
[ INFO] 1279298645.895816000: rcv: 1279298645.895764 0.000000 0.000000
[ INFO] 1279298646.107659000: rcv: 1279298646.107610 0.000000 0.000000
[ INFO] 1279298646.314695000: rcv: 1279298646.314645 0.000000 0.000000
[ INFO] 1279298646.530481000: rcv: 1279298646.530432 0.000000 0.000000
[ INFO] 1279298646.742306000: rcv: 1279298646.742257 0.000000 0.000000
[ INFO] 1279298646.950521000: rcv: 1279298646.950469 0.000000 0.000000
[ INFO] 1279298647.165970000: rcv: 1279298647.165921 0.000000 0.000000
[ INFO] 1279298647.377985000: rcv: 1279298647.377937 0.000000 0.000000
[ INFO] 1279298647.588941000: rcv: 1279298647.588892 0.000000 0.000000
[ INFO] 1279298647.795942000: rcv: 1279298647.795893 0.000000 0.000000
[ INFO] 1279298648.119641000: rcv: 1279298648.119591 0.000000 0.000000

Ahora para poder controlarlo como lo hice con el robot simulado utilizado el nodo de teleop_base_keyboard lo que tengo que hacer es encargarme de crear un nuevo nodo especial para el pioneer y hacer que publique en el mismo topico que el del robot y se puedan comunicar.

Antes que nada veo que nodos están operando y así darme cuenta cual utiliza el robot para su movimiento. Ejecuto el siguiente comando:

oscar@oscar-MAC:/opt/ros/boxturtle/ros$ rostopic list

y me aparece algo como lo siguiente:

/RosAria/cmd_vel
/RosAria/pose
/clock
/rosout
/rosout_agg
/tf
/time

Ahí me doy cuenta que el nodo mediante el cual se le indica como moverse es el de cmd_vel

Ahora lo que tengo que hacer es moverme al directorio de teleop_base

roscd teleop_base

De ahí accesar al src y ver que archivo .cpp hay del teleop_base_keyboard y accesar a el. Lo que quiero hacer es modificar el nombre del topico al cual se publica para poder tener comunicación con el robot, pero como tampoco quiero modificar el archivo base con el cual hago el movimiento del robot simulado, modifico el archivo y lo guardo como teleop_base_keyboardARIA.cpp

Para poder publicar al tópico busco en el código el objeto TBK_Node (anexo el codigo completo al final) y en el modifico:

"base_controller/command"

por el path del topico que vi anteriormente, oseare por:

"RosAria/cmd_vel"


Aquí se aprecia bien donde se encuentra base_controller/command

Una vez modificado y guardado subo nuevamente al directorio de teleop_base y modifico el archivo de CMakeLists.txt para dar de alta el nodo. Lo que hago es agregar el ejecutable como tal (teleop_base_keyboardARIA) de esta forma:

rosbuild_add_executable(teleop_base_keyboardARIA src/teleop_base_keyboardARIA.cpp)

Lo pego al final del texto.

Lo guardo y en el mismo directorio de teleop_base hago rosmake (pero lo tengo que hacer como root porque si no hay partes de la compilación que no me permite realizar).

Una vez que el package está compilado escribo ls para ver si el directorio fue creado.

Confirmo lo anterior y entonces ejecuto con el siguiente comando:

root@oscar-MAC:/opt/ros/boxturtle/ros/teleop_base# ./teleop_base_keyboardARIA

Entonces sale la ventana desde la cual puedo controlar el Pioneer con el teclado >.<:


Aquí se aprecia que el nodo teleop_base_keyboardARIA está dado de alta y es ejecutable, así mismo abajo se aprecian los comandos con los cuales se puede operar al robot.


Nuestro robot Pioneer XD.

*********

Listo Ahora para aprender a utilizar el Sick Laser tengo que estudiar el tutorial:
Using SICK Laser Scanners with the sicktoolbox_wrapper:
http://www.ros.org/wiki/sicktoolbox_wrapper/Tutorials/UsingTheSicklms

Hubo un correo de Renato en donde comenta que tuvo que hacer un delay del sick, se lo pediré a Laura y una vez terminado ese tutorial le pediré ayuda a Renato vía correo. Queda de tarea ver los videos de stanford, consguir hojas técnicas del laser sick y del robot, así como terminar de aprender HTML XML y JAVA, conseguir un tutorial de phyton y continuar con el de C++. No estaría demás buscar una suerte de foro o algo de donde sacar info relevante de robots.

Esto es todo por hoy. XD
----------------------------

Anexos:

Renato Samperio añadió a Oscar Rodrigo Hernandez Panczenko a este chat
09:12
Renato Samperio
09:12
http://subversion.assembla.com/svn/ssc-rovers/sscrovers-ros-pkg/sscrovers_2dnav/src/
09:12

svn up
09:13

svn co http://subversion.assembla.com/svn/ssc-rovers/sscrovers-ros-pkg/
09:14

svn commit -m "Agreguen el mensaje con descripcion"
09:15

http://subversion.assembla.com/svn/ssc-rovers/sscrovers-ros-pkg/sscrovers_2dnav/src/
09:15

svn add nombre.cpp
09:17

http://subversion.assembla.com/svn/ssc-rovers/sscrovers-ros-pkg/
09:20

http://www.ros.org/wiki/karto
09:27

http://subversion.assembla.com/svn/ssc-rovers/sscrovers-ros-pkg/sscrovers_tf_conf/src/
09:30

http://academicearth.org/courses/introduction-to-robotics
09:32

http://subversion.assembla.com/svn/ssc-rovers/sscrovers-ros-pkg/sscrovers_tf_conf/src/tf_listener.cpp
Laura Isabel Galindez Olascoaga
09:38
http://www.ros.org/wiki/slam_gmapping/Tutorials/MappingFromLoggedData
Renato Samperio
09:41
roscd sscrovers-ros-pkg/
09:41

roslaunch launch/create-map.launch
09:42

rosrecord -f sscrovers_2dnav/bags/sscrovers /base_scan /tf
09:46

rosplay sscrovers_2dnav/bags/
09:48

rosrun map_server map_saver map:=map

-------------------------------

teleop_base_keyboard.cpp:

/*
* teleop_base_keyboard
* Copyright (c) 2008, Willow Garage, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/

#include
#include
#include
#include
#include
#include

#include
#include
#include

#define KEYCODE_I 0x69
#define KEYCODE_J 0x6a
#define KEYCODE_K 0x6b
#define KEYCODE_L 0x6c
#define KEYCODE_Q 0x71
#define KEYCODE_Z 0x7a
#define KEYCODE_W 0x77
#define KEYCODE_X 0x78
#define KEYCODE_E 0x65
#define KEYCODE_C 0x63
#define KEYCODE_U 0x75
#define KEYCODE_O 0x6F
#define KEYCODE_M 0x6d
#define KEYCODE_R 0x72
#define KEYCODE_V 0x76
#define KEYCODE_T 0x74
#define KEYCODE_B 0x62

#define KEYCODE_COMMA 0x2c
#define KEYCODE_PERIOD 0x2e

#define COMMAND_TIMEOUT_SEC 0.2

// at full joystick depression you'll go this fast
double max_speed = 0.500; // m/second
double max_turn = 60.0*M_PI/180.0; // rad/second
// should we continuously send commands?
bool always_command = false;


class TBK_Node
{
private:
geometry_msgs::Twist cmdvel;
ros::NodeHandle n_;
ros::Publisher pub_;

public:
TBK_Node()
{
pub_ = n_.advertise("base_controller/command",1);
}
~TBK_Node() { }
void keyboardLoop();
void stopRobot()
{
cmdvel.linear.x = cmdvel.angular.z = 0.0;
pub_.publish(cmdvel);
}
};

TBK_Node* tbk;
int kfd = 0;
struct termios cooked, raw;
bool done;

int
main(int argc, char** argv)
{
ros::init(argc,argv,"tbk", ros::init_options::AnonymousName | ros::init_options::NoSigintHandler);
TBK_Node tbk;

boost::thread t = boost::thread::thread(boost::bind(&TBK_Node::keyboardLoop, &tbk));

ros::spin();

t.interrupt();
t.join();
tbk.stopRobot();
tcsetattr(kfd, TCSANOW, &cooked);

return(0);
}

void
TBK_Node::keyboardLoop()
{
char c;
double max_tv = max_speed;
double max_rv = max_turn;
bool dirty=false;

int speed=0;
int turn=0;

// get the console in raw mode
tcgetattr(kfd, &cooked);
memcpy(&raw, &cooked, sizeof(struct termios));
raw.c_lflag &=~ (ICANON | ECHO);
raw.c_cc[VEOL] = 1;
raw.c_cc[VEOF] = 2;
tcsetattr(kfd, TCSANOW, &raw);

puts("Reading from keyboard");
puts("---------------------------");
puts("q/z : increase/decrease max angular and linear speeds by 10%");
puts("w/x : increase/decrease max linear speed by 10%");
puts("e/c : increase/decrease max angular speed by 10%");
puts("---------------------------");
puts("Moving around:");
puts(" u i o");
puts(" j k l");
puts(" m , .");
puts("anything else : stop");
puts("---------------------------");

struct pollfd ufd;
ufd.fd = kfd;
ufd.events = POLLIN;
for(;;)
{
boost::this_thread::interruption_point();

// get the next event from the keyboard
int num;
if((num = poll(&ufd, 1, 250)) < 0)
{
perror("poll():");
return;
}
else if(num > 0)
{
if(read(kfd, &c, 1) < 0)
{
perror("read():");
return;
}
}
else
continue;

switch(c)
{
case KEYCODE_I:
speed = 1;
turn = 0;
dirty = true;
break;
case KEYCODE_K:
speed = 0;
turn = 0;
dirty = true;
break;
case KEYCODE_O:
speed = 1;
turn = -1;
dirty = true;
break;
case KEYCODE_J:
speed = 0;
turn = 1;
dirty = true;
break;
case KEYCODE_L:
speed = 0;
turn = -1;
dirty = true;
break;
case KEYCODE_U:
turn = 1;
speed = 1;
dirty = true;
break;
case KEYCODE_COMMA:
turn = 0;
speed = -1;
dirty = true;
break;
case KEYCODE_PERIOD:
turn = 1;
speed = -1;
dirty = true;
break;
case KEYCODE_M:
turn = -1;
speed = -1;
dirty = true;
break;
case KEYCODE_Q:
max_tv += max_tv / 10.0;
max_rv += max_rv / 10.0;
if(always_command)
dirty = true;
break;
case KEYCODE_Z:
max_tv -= max_tv / 10.0;
max_rv -= max_rv / 10.0;
if(always_command)
dirty = true;
break;
case KEYCODE_W:
max_tv += max_tv / 10.0;
if(always_command)
dirty = true;
break;
case KEYCODE_X:
max_tv -= max_tv / 10.0;
if(always_command)
dirty = true;
break;
case KEYCODE_E:
max_rv += max_rv / 10.0;
if(always_command)
dirty = true;
break;
case KEYCODE_C:
max_rv -= max_rv / 10.0;
if(always_command)
dirty = true;
break;
default:
speed = 0;
turn = 0;
dirty = true;
}
if (dirty == true)
{
cmdvel.linear.x = speed * max_tv;
cmdvel.angular.z = turn * max_rv;

pub_.publish(cmdvel);
}
}
}

jueves, 15 de julio de 2010

Control del PIONEER

Al momento de grabar el mapa en un .bag, no me dejaba hacerlo a menos que fuese como ROOT, al parecer una vez hecho esto todo el resto del tutorial lo pude hacer sin problemas.

Ahora me encuentro bajando el nodo para utilizar el lasr SICK. La página de ROS en donde viene la información y los stacks necesarios es:

http://www.ros.org/wiki/sicktoolbox_wrapper

Ahí mismo accese a la página con el package sicktoolbox_wrapper:

https://code.ros.org/svn/ros-pkg/stacks/laser_drivers/trunk/sicktoolbox_wrapper/

Nota: Renato escribió lo siguiente acerca de este nodo:

" Cuando yo lo hice tuve que hacer una modificacion al codigo del Nodo porque mi SICK viene embedida una unidad con la que se enciende y se apaga. Esta unidad es activada manualmente pero tambien por software y se tardaba mas tiempo en encender que lo que el nodo podia esperar. Asi que dormi el nodo por 20 segs (tiempo que se tarda en encender son 24segs) y despues vuelve a ejecutar el nodo. Este "nodo" modificado lo puedes encontrar en el assembla como sscrovers_laser_pub en un try-catch anidado del archivo sicklms.cpp."

Ahora bajaré el contenido en la dirección:

oscar@oscar-MAC:/opt/ros/boxturtle/ros$

Mediante el siguiente comando:

$ svn co https://code.ros.org/svn/ros-pkg/stacks/laser_drivers/trunk/sicktoolbox_wrapper/ sicktoolbox_wrapper

Al intentarlo como usuario no me dejó, me marco que no tengo el permiso para descargar el archivo, por lo cual lo intentaré con sudo.

Listo ahora si funcionó y me imprimio lo siguiente en pantalla:

oscar@oscar-MAC:/opt/ros/boxturtle/ros$ sudo svn co https://code.ros.org/svn/ros-pkg/stacks/laser_drivers/trunk/sicktoolbox_wrapper/ sicktoolbox_wrapper
[sudo] password for oscar:
A sicktoolbox_wrapper/ros
A sicktoolbox_wrapper/ros/sicklms
A sicktoolbox_wrapper/ros/sicklms/sicklms.cpp
A sicktoolbox_wrapper/ros/sicklms/CMakeLists.txt
A sicktoolbox_wrapper/ros/CMakeLists.txt
A sicktoolbox_wrapper/manifest.xml
A sicktoolbox_wrapper/sick_test.vcg
A sicktoolbox_wrapper/standalone
A sicktoolbox_wrapper/standalone/print_scans.cpp
A sicktoolbox_wrapper/standalone/time_scans.cpp
A sicktoolbox_wrapper/standalone/log_scans.cpp
A sicktoolbox_wrapper/standalone/CMakeLists.txt
A sicktoolbox_wrapper/mainpage.dox
A sicktoolbox_wrapper/CMakeLists.txt
A sicktoolbox_wrapper/Makefile
U sicktoolbox_wrapper
Checked out revision 30868.

Al momento de compilarlo con rosmake me salió el siguiente error:

oscar@oscar-MAC:/opt/ros/boxturtle/ros/sicktoolbox_wrapper$ rosmake
[ rosmake ] No package selected and the current directory is not the correct path for package 'sicktoolbox_wrapper'.
[ rosmake ] Packages requested are: []
[ rosmake ] Logging to directory
[ rosmake ] /home/oscar/.ros/rosmake/rosmake_output-20100715-104540
[ rosmake ] Expanded args [] to:
[]
[ rosmake ] ERROR: No arguments could be parsed into valid package or stack names.
oscar@oscar-MAC:/opt/ros/boxturtle/ros/sicktoolbox_wrapper$ sudo su
root@oscar-MAC:/opt/ros/boxturtle/ros/sicktoolbox_wrapper# rosmake
[ rosmake ] No package selected and the current directory is not the correct path for package 'sicktoolbox_wrapper'.
[ rosmake ] Packages requested are: []
[ rosmake ] Logging to directory
[ rosmake ] /root/.ros/rosmake/rosmake_output-20100715-104548
[ rosmake ] Expanded args [] to:
[]
[ rosmake ] ERROR: No arguments could be parsed into valid package or stack names.

Intenté compilarlo con ROOT pero me salió el mismo error.

Ahora intentaré compilarlo con rosmake pero con el path y el nombre del package.

Ahora escribí el comando: oscar@oscar-MAC:/opt/ros/boxturtle/ros$ rosmake sicktoolbox_wrapper

Sí compiló la mayor parte del código, sin embargo me mostró un mensaje al final argumentando lo siguiente:

mkdir: cannot create directory `build': Permission denied

Entonces ahora lo intentaré con privilegios de ROOT.

Listo ahora si se compiló, me imprimió el siguiente mensaje:

[rosmake-0] <<< sicktoolbox_wrapper <<< [PASS] [ 16.28 seconds ] -- WARNING: 4 compiler warnings


> Ahora continuaré con la compilación de ARIA, creo que este package ya lo habia compilado antes pero lo haré nuevamente.

Los packages de AIRA se encuentran en el siguiente directorio:

oscar@oscar-MAC:/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_odometry

Desde este directorio compilaré Aria y ROSARIA, primero lo haré con usuario y rosmake Aria a ver si funciona.

Se compiló sin problemas.

Ahora continuaré con ROSARIA de la misma forma.

Al final de la compilación me marcó el siguiente error:

mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake ..
[rosbuild] Building package ROSARIA
[rosbuild] Including /opt/ros/boxturtle/ros/core/rospy/cmake/rospy.cmake
[rosbuild] Including /opt/ros/boxturtle/ros/core/roscpp/cmake/roscpp.cmake
-- Configuring done
CMake Error: Unable to open cache file for save. /opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_odometry/ROSARIA/build/CMakeCache.txt
CMake Error: : System Error: Permission denied

"Permission denied" ... Lo intentaré con sudo.

Me imprimió lo siguiente:

sudo: rosmake: command not found

Ahora lo intentaré como ROOT#.

Se compiló sin problemas y me imprimió lo siguiente:

[rosmake-0] <<< ROSARIA <<< [PASS] [ 1.53 seconds ]

Procederé a conectar el PIONEER con el serial.

Primero tengo que cambiar el canal, pero al momento de tratar de accesar a /usr/local/Aria no tengo el directorio. Me fijé en el synaptics package manager y no tengo instalado nada de Aria... raro.

Instalé el package: libmrpt-aria0.6

Laura tiene la versión 0.8, al parecer no me aparece a mi esa opción al buscarla por la versión de ubuntu que tengo, procederé a actualizarla... puede que me lleve un rato... GO

viernes, 9 de julio de 2010

Alternativa...

La respuesta de Renato para el problema fue:

"Hola Oscar,

Esos 3 paquetes son de la stereo camara que estamos usando. Podrias quitarlo de la compilacion general tambien el PGR?

Saludos,

Renato."

Entonces en vez de compilar todos los paquetes aplicando simplemente rosmake decidí compilar todos los paquetes menos el siguiente (los compilé con privilegios de administrador #): sscrovers_vision

Todos los demás paquetes se compilaron sin mayor problema, continuaré con el tutorial.

jueves, 8 de julio de 2010

Solucion al compilar el package: sscrover-ros-pkg.

Renato me indicó que tengo que eliminar la dependencia al package denominado: libdc1394v2

Correo original:

"Hola Oscar,

Borra la dependencia de esos dos packages: libdc1394v2 y pgrlibdcstereo.

Que estas tratando de compilar? Me parece que se me han de haber colado estas dependencias en algun manifest.xml.


Saludos,

Renato."

Hasta ahora lo he eliminado en los manifest.xml (realmente comentado) de los packages:
pgrlibdcstereo
Triclops

Encontrados en el Stack: sscrovers_vision

Ahora es cosa de ver como sigue, si compila o si no....

y que no compila... ahora sale un error bien kñon.. a ver... parece ser que se tienen muchos errores en el archivo: pgr_stereocam.cpp a partir de la línea 706.

Errores:
----------------------------------------------
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:706: error: expected `;' before ‘err’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:707: error: ‘err’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:707: error: ‘struct PGRStereoCamera_t’ has no member named ‘camera’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:707: error: ‘writeTriclopsConfigFromCameraToFile’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:708: error: ‘DC1394_SUCCESS’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp: At global scope:
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:732: error: ‘dc1394bayer_method_t’ has not been declared
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp: In function ‘void extractImagesColorXB3(PGRStereoCamera_t*, int, unsigned char*, unsigned char*, unsigned char*, unsigned char**, unsigned char**, unsigned char**, TriclopsInput*, TriclopsInput*)’:
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:743: error: ‘dc1394error_t’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:743: error: expected `;' before ‘err’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:744: error: ‘dc1394video_frame_t’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:744: error: ‘frame’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:745: error: ‘err’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:745: error: ‘struct PGRStereoCamera_t’ has no member named ‘camera’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:746: error: ‘DC1394_CAPTURE_POLICY_WAIT’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:747: error: ‘dc1394_capture_dequeue’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:748: error: ‘DC1394_SUCCESS’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:766: error: ‘struct PGRStereoCamera_t’ has no member named ‘bayerTile’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:767: error: ‘dc1394_bayer_decoding_8bit’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:797: error: ‘struct PGRStereoCamera_t’ has no member named ‘camera’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:797: error: ‘dc1394_capture_enqueue’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp: In function ‘void extractImagesMonoXB3(PGRStereoCamera_t*, unsigned char*, unsigned char**, unsigned char**, unsigned char**, TriclopsInput*, TriclopsInput*)’:
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:817: error: ‘dc1394error_t’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:817: error: expected `;' before ‘err’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:819: error: ‘dc1394video_frame_t’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:819: error: ‘frame’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:820: error: ‘err’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:820: error: ‘struct PGRStereoCamera_t’ has no member named ‘camera’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:821: error: ‘DC1394_CAPTURE_POLICY_WAIT’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:822: error: ‘dc1394_capture_dequeue’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:823: error: ‘DC1394_SUCCESS’ was not declared in this scope
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:867: error: ‘struct PGRStereoCamera_t’ has no member named ‘camera’
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp:867: error: ‘dc1394_capture_enqueue’ was not declared in this scope
make[3]: *** [CMakeFiles/pgrlibdcstereo.dir/src/pgr_stereocam.o] Error 1
make[3]: Leaving directory `/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/build'
make[2]: *** [CMakeFiles/pgrlibdcstereo.dir/all] Error 2
make[2]: Leaving directory `/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/build'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/build'
--------------------------------

Como se puede ver el archivo es el siguiente path:
/opt/ros/boxturtle/ros/sscrovers-ros-pkg/sscrovers_vision/pgrlibdcstereo/src/pgr_stereocam.cpp

Seguiré invesitgando este error..

Bitacora V1


Bitacora de la instalación de los programas para manipular al pioneer.

1.- Primero entré a la página:
http://www.assembla.com/wiki/show/ssc-rovers/Starting_with_ROS

2.- Abrí la terminal e instalé lo siguiente:
$ svn co https://code.ros.org/svn/wg-ros-pkg/branches/trunk_cturtle/sandbox/teleop_base

3.- Después instalé:

$ rosrun rviz rviz -d /opt/ros/boxturtle/stacks/simulator_stage/stage/rviz/stage.vcg
------------------
Haré un paréntesis para ver un detalle de .bshrc.

Resulta que para tener acceso como root basta con escribir sudo su.

Copié la línea: -del path-

Del .bashrc del usuario al .basrc del root. Para accesar al .bashrc del usuario basta con ir al directorio:

/path /home/username/inst (inst se refiere a que ahi se encuentra dihco archivo)

y editar el .bashrc, creo que utilicé sudo para hacer esto.

Para accesar al .basrc del root, escribi cd, accese como root (sudo su) y luego use el comando:
gedit .bashrc

Para localiar un archivo puedo escribir:
locate archivo

Para localizar un archivo en la web debes de escribir:
roslocate svn nombrearchivo
Para descargar un archivo de la web
svn co direccionarchivo
------------------
Tras modificar los archivos setup.sh tanto de la carpeta del boxturtle como del beginner_tutorials y entrar como root, pude finalmente instalar adecuadamente el control_toolbox y el teleop_base así como instalarlos. Una vez hecho esto pude correr el teleop_base_keyboard para controlar el robot simulado.

Resulta ser que es precisamente en este documento en donde se designa que path se puede considerar como acceso para ROS_ROOT y entonces poder usar comandos de ROS como ROOT.

4.-Despues vi los tutoriales de Transorm for broadcaster and listener ,el tutorial del tf y de los sensores. Existe mucho material disponible sobre el tf, así como vieos muy interesantes.

5.-Ahora sigo con el de building a map
----
Listo ya cree un mapa con el tutorial. Otro dato interesante para la terminal es que puedes abrir imagenes con gimp .
----
Bueno ahorita me quede trabado al tratar de compilar el paquete que descargargué inmediatamente despues llamado: sscrovers-ros-pkg. Le mandé un correo a renato esperando una solución.

Lo que sigue por amientras es lo siguiente:
Imprimir el archivo printing.odt (esta en google docs) y estudiarlo
Imprimir el datasheet
Buscar tutorial de python en la web.
Buscar info sobre el laser sick y el robot pioneer, mandar un correo a pineda para solicitarsela nuevamente.
Buscar los tutoriales que dice laura de navegación.
Leer sobre navigation tutorials (igual y es lo mismo)
Conseguir info de libros y recursos web sobre navegación
Terminar tutorial HTML y JAVA para empezar con XML
Repasar temas de C++
Limpiar la MAC >.<

Nota: Esta bitacora no es de un solo día, la subi a la web como respaldo de un .odt que hice muy informal.

martes, 29 de junio de 2010

7)Understaning ROS Services and Parameters

7)Understaning ROS Services and Parameters

rosservice es otro medio mediante el cual los nodos se pueden comunicar entre si. Los services permiten a los nodos enviar request y recibir response.

rosservice tiene varios comandos que pueden ser usados en topics.

-rosservice list
Esta función permite ver que servicios están disponibles por el nodo en cuestión.

-rossservice type [service]
Esta función permite saber que tipo de servicio es service, osea que argumentos recibe y cuales envia.

-rosservice call [service] [args]
Esta función llama al servicio en cuestión.

rosparam permite almacenar y manipular información información en el ROS Parameter Server

-rosparam list
Esta función permite desplegar los parametros.

-rosparam set
Esta función permite cambiar el parametro a lo que deseemos

-rosparam get
Esta función permite obtener el valor de un parametro


rosparam set set parameter
rosparam get get parameter
rosparam load load parameters from file
rosparam dump dump parameters to file
rosparam delete delete parameter
rosparam list list parameter names

lunes, 28 de junio de 2010

6) Understanding ROS Topics

6) Understanding ROS Topics

Vaya por fin entiendo bien el concepto de para que es un msg, un topic y un nodo. Resulta que cada nodo es una suerte de programa por si mismo que se comunica con otros nodos que hacen otras cosas para hacer en conjunto alguna tarea de un nivel superior. Se comunican a través de una suerte de board llamado topic en donde ellos publican lo que hacen a través de msgs. Se usa un topic de por medio para que sea de uso universal sin importar en que lenguaje esté programado el nodo, osea todo lo que tenga el nodo dentro. Un nodo puede publicar y/o subscribirse a un topic para enviar y/o recibir msgs que le indican cosas, tareas, info etc.

-rxgraph
Esta función pone en pantalla un diagrama en donde muestra los diferentes nodos que se están utilizando y los topicos que los interconectan.

-rostopic
Permite obtener información de distintos tipos acerca de un tipo, desde a que frecuencia se comunica, la lista de topicos activos, el tipo de topico etc.

Para ver en la terminal lo que está enviando un topic es necesario utilizar la función echo. Por ejemplo:

$ rostopic echo /turtle1/command_velocity

Para cada tipo de tópico hay un tipo de message que se utiliza para la comunicación a través del tópico. Para saber que tipo de mensaje es se escribe:
-rostopic type “topico”

-rostopic pub [topic] [msg_type] [args]
Esta función se utiliza para enviar info a un topico.

-rostopic hz [topic]
Esta función se utiliza para ver a que rate está enviando y recibiendo info el topico.

-rxplot
Esta función se utilliza para crear una gráfica dinámica de como estan siendo utilizadas las funciones de un topico en función del tiempo.

5) Entendiendo los Nodos.

5) Entendiendo los Nodos.

Un nodo es un conjunto de packages que realizan una tarea completa en conjunto. En este modulo se aprende a utilizar los siguientes comandos:

-roscore
Este comando es lo primerito que se tiene que correr si se piensa comenzar a utilizar ROS

-rosnode
Da una lista de los nodos que se encuentran activos

-rosnode info/”node”
Despliega información acerca de dicho nodo.

-rosrun [package_name] [Node_Name] corre el nodo que se encuentra en dicho package.

-rosnode ping
Envía pings para ver si el nodo se encuentra activo.

4)Creating a ROS msg and srv.

4)Creating a ROS msg and srv.

Los archivos msg son simples documentos de texto qe describe los campos de un mensage de ROS. Un utilizados para generar codigo para mensajes en diferentes lenguajes de programación.

Los srv describen un servicio, se compone principalmente de dos partes la solicitud y la respuesta.

Para creacr un msg primero te diriges al paquete en donde lo vas a crear, despues lo creas y por último lo editas.

ej.
$ roscd beginner_tutorials
$ mkdir msg
$ echo "int64 num" > msg/Num.msg

¿Porque tenemos que abrir CmakeLists.txt en este paso?

Al momento de utilizar rosmsg se puede ver el contenido de un msg.

Example:
$ rosmsg show beginner_tutorials/Num
You will see:
int64 num
Para crear un srv se hace de la misma forma.

$ roscd beginner_tutorials
$ mkdir srv
Así mismo se puede copiar de otro directorio utilizando roscp.

Usage:
$ roscp [package_name] [file_to_copy_path] [copy_path]
Now we can copy a service from the rospy_tutorials package:
$ roscp rospy_tutorials AddTwoInts.srv srv/AddTwoInts.srv
Para ver el contenido de un srv se utiliza el comando rossrv show.

ej.

Example:
$ rossrv show beginner_tutorials/AddTwoInts
You will see:
int64 a
int64 b
---
int64 sum
Siempre que se modifica un msg se tiene que compilar nuevamente el package.
$ rosmake beginner_tutorials
Ayuda.

Para obtener ayuda acerca de un comando se puede escrobir depsues del mismo: -h
Esto sirve para la mayor parte de comandos existentes y permite desplegar información acerca del mismo comando en pantalla.

ej.

Try:
$ rosmsg -h
You should see a list of different rosmsg subcommands.
Commands:
rosmsg show Show message description
rosmsg users Find files that use message
rosmsg md5 Display message md5sum
rosmsg package List messages in a package
rosmsg packages List packages that contain messages
You can also get help for subcommands
$ rosmsg show -h
This shows the arguments that are needed for rosmsg show:
Usage: rosmsg show [options]

Options:
-h, --help show this help message and exit
-r, --raw show raw message text, including comments