Archive for category Programacion / Programming

Installing ROS electric and ROS diamondback on Ubuntu Oneiric (11.10)

The thing is that I installeds first on Ubuntu 11.10 ROS electric using their instructions, then I needed to install ROS diamondback.

I tried to use their instructions to install it from the repositories and I found this problem:

sudo apt-get install ros-diamondback-desktop-full
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:
ros-diamondback-desktop-full : Depends: ros-diamondback-ros-tutorials (= 0.2.4-s1312445230~lucid) but it is not going to be installed
Depends: ros-diamondback-geometry-tutorials (= 0.1.3-s1312445373~lucid) but it is not going to be installed
Depends: ros-diamondback-slam-gmapping (= 1.2.3-s1312435634~lucid) but it is not going to be installed
Depends: ros-diamondback-ros (= 1.4.9-s1312417708~lucid) but it is not going to be installed
Depends: ros-diamondback-visualization (= 1.4.1-s1312432000~lucid) but it is not going to be installed
Depends: ros-diamondback-vision-opencv (= 1.4.3-s1312425872~lucid) but it is not going to be installed
Depends: ros-diamondback-perception-pcl (= 0.10.0-s1312427042~lucid) but it is not going to be installed
Depends: ros-diamondback-rx (= 1.4.2-s1312430459~lucid) but it is not going to be installed
Depends: ros-diamondback-image-pipeline (= 1.4.2-s1312437407~lucid) but it is not going to be installed
Depends: ros-diamondback-simulator-gazebo (= 1.2.8-s1312440157~lucid) but it is not going to be installed
Depends: ros-diamondback-diagnostics-monitors (= 1.4.0-s1312439740~lucid) but it is not going to be installed
Depends: ros-diamondback-simulator-stage (= 1.2.5-s1312437801~lucid) but it is not going to be installed
Depends: ros-diamondback-image-common (= 1.4.1-s1312425748~lucid) but it is not going to be installed
Depends: ros-diamondback-common-tutorials (= 0.1.2-s1312463072~lucid) but it is not going to be installed
Depends: ros-diamondback-ros-comm (= 1.4.7-s1312424712~lucid) but it is not going to be installed
Depends: ros-diamondback-visualization-common (= 1.4.2-s1312430681~lucid) but it is not going to be installed
Depends: ros-diamondback-physics-ode (= 1.4.1-s1312430103~lucid) but it is not going to be installed
Depends: ros-diamondback-driver-common (= 1.2.3-s1312425659~lucid) but it is not going to be installed
Depends: ros-diamondback-executive-smach (= 1.0.2-s1312435548~lucid) but it is not going to be installed
Depends: ros-diamondback-common-msgs (= 1.4.0-s1312425065~lucid) but it is not going to be installed
Depends: ros-diamondback-image-transport-plugins (= 1.4.1-s1312426755~lucid) but it is not going to be installed
Depends: ros-diamondback-robot-model (= 1.4.0-s1312427974~lucid) but it is not going to be installed
Depends: ros-diamondback-visualization-tutorials (= 0.2.2-s1312464635~lucid) but it is not going to be installed
Depends: ros-diamondback-geometry (= 1.4.2-s1312425346~lucid) but it is not going to be installed
Depends: ros-diamondback-documentation (= 1.4.1-s1312464754~lucid) but it is not going to be installed
Depends: ros-diamondback-executive-smach-visualization (= 1.0.1-s1312459854~lucid) but it is not going to be installed
Depends: ros-diamondback-laser-pipeline (= 1.2.0-s1312429600~lucid) but it is not going to be installed
Depends: ros-diamondback-common (= 1.4.3-s1312425161~lucid) but it is not going to be installed
Depends: ros-diamondback-diagnostics (= 1.4.0-s1312425553~lucid) but it is not going to be installed
Depends: ros-diamondback-navigation (= 1.4.1-s1312429823~lucid) but it is not going to be installed”

I started trying to correct it and I followed the next (failed) steps:
So I tried to install it from source with this instructions. In a step (in the package geometry) I got asked for an user and password, I just hit Enter and everything went fine.

Changed the path where to install as by default is ~/ros but I found it nicer to be in /opt.

This lasted… one hour. And I got an error in the end, so I wasn’t happy.

So I found this link: http://answers.ros.org/question/2505/installing-ros-diamondback-on-ubuntu-1110-oneiric
Where a good soul explains how to install it. I find it ugly, but works!

Oh, and finally I need to be sure that I am using the correct version of ROS putting in my .bashrc the line:

source /opt/ros/diamondback/setup.bash

(or the one that is correct in that moment, electric, or diamondback).

Tags: , ,

Light painting with a homemade robot arm

This is my last finished project. It’s a homemade robot arm with a RGB LED in the terminal element so we can paint with it. In the end of the post I’ll link to the PDF of the project and the powerpoint I used in class (in spanish) to present it. When I have time I’ll upload some videos.

We built the robot in our association AESS and I programmed a simulator in python of the arm that implements the inverse kinematics and the needed stuff to paint an image or the points that we need.

PDF: http://awesomebytes.com/wp-content/uploads/2011/12/Documentacion-Brazo-LED.pdf
Powerpoint: http://awesomebytes.com/wp-content/uploads/2011/12/PresentacionBrazoSammyPfeiffer.pdf

Tags: , , ,

Playing a .mp3 file from Java

A coleague needed to play an .mp3 file in an easy way using Java and after searching a bit we found a easy player to do it, here youc an see the code to do it:

Thank you for sharing Lluis, keep working!

Tags: , ,

C Humanoid Lab libraries for Bioloid Premium

Trying to use the library of http://apollo.upc.es/humanoide/trac/wiki/bioloidCframeworks to program the Bioloid I’ve found a couple of problems to compile my project.
I found out that in AVRStudio5.0 I couldn’t build my project because he couldn’t find the lib (.a) of the project. This is so because when you download the project you don’t have the libraries compiled. To solve this problem I needed to execute make in every directory of the libraries:
-motion
-controllers
-dyn_device
Doing this I’ve found that I couldn’t compile it because the PATH to the directory of the embeded_c of Robotis contained brackets (and spaces) and Make didn’t like that. So I just moved the directory to the root of my partition. So I executed: make ROBOTIS_C_DIR=M:\embeded_c
Once the three libraries were compiled the project in AVRStudio build correctly.

Tags: , , ,

Checksum on the motionfiles (.mtn) of the Bioloid

Working with a Bioloid I had the need of modifying a pose file of the Bioloid. This file is structured as a text file that starts with the bytes 0xEF 0xBB 0xBF and after that it details every pose and its data (the position of every motor, etc). I found that in the end of the file there is attached a Checksum, and without that Checksum the Bioloid and it’s software won’t recognize the file.
This Checksum is formed of 2 bytes computed adding the value of every byte of the file 8(including the carriage returns in UNIX format) and in the end changing the sign of the result and getting only the last 2 bytes. This Checksum is added at the end of the file (in the last line, after a carriage return).

Here you can see the Python code that opens the file (that only needs the checksum in the last line) and computes and writes the Checksum.

Tags: , ,

Moving Bioloid arms with a Kinect

Video of my project.
On one side I obtain the data of the Skeleton of the user using OSCeleton.
On the other side I have my application programmed in Python where I parse the coordinates of the different joints obtained via OSCeleton (using the OSC protocol, parsing with SimpleOSC). This same application simulates the Bioloid and calculates the inverse kinematics so I am able to position the motors. For making the simulation I used VPython.

Thanks to this project I’ve learned a lot about robotics, inverse kinematics, python I wanted to learn python for this project), OSC protocol and I re-learned a lot of geometry and trigonometry.

Tags: , , ,

Installing OSCeleton Sensebloom in Windows 7 64 bits

To install OSCeleton you must follow the steps that you can find at SensorKinect but they don’t mention a couple of details:

-You must install the 32 bit version of OpenNI and NITE because SensorKinect does not have a 64bit version and it does not recognize the 64 bits of them installed.

-You must go to environment variables (Control Panel\System and security\System, left, advanced system settings, down you find EnvironmentVariables) and modify the register OPEN_NI_BIN so it contains: C:\Program Files (x86)\OpenNI\Bin (for me), the difference is that it said “bin” and not “Bin” in my default installation so it does not find the binaries. If you don’t make this change when you try to execute some demo you will get: “OpenNI library can’t find any module!”.

Found the solution in this thread,

Tags: , , , , ,

Read and write in the register from C#

A friend and me wanted to learn how to read registry entries from C# (to learn some C#, learn something about Windows API calls and for doing something useful).
For our porpouse we chose an IDE: SharpDevelop. Its free and opensource.
We needed some reference information, and we found (spanish) this ubicuos article.
So the code looks like this:

Read the rest of this entry »

Tags: , , , , , ,

Installing WeTab on a ExoPC

Steps to install WeTab (SO based in MeeGo) on a ExoPC (we need an USB keyboard!):

Download the SO image at this link, this is the official torrent: Torrent (1GB).

Load the image in a pendrive, to do that we can follow the instructions of meego, I used the Windows option:

1.Download win32imagewriter
2.Extract and open the app.
3.Select the cd of MeeGo image (if you don’t see it, rename the image with the extension .img) and select the pendrive unit.
4.Click Write.

Stick in the pendrive and select to boot from the USB (hit F11 with the keyboard or touch on the BBS option in the first screen of the ExoPC).

In the recovery of WeTab screen we will need to hit Control+Alt+F3 to get into the console. The login & password are: “root” and “wetab”.

The next step is to execute the next command:
tiitoo-installer.sh silent_installer /mnt/live/system.tar.bz2

It will be 5-10minutes of installation. When it finishes write reboot and in the next boot, we will be at the WeTab installation.

I’m waiting for the install to end, it needs to download a lot of updates (it says 45min at least!). I’ll write about what I think soon!

Source: meetmeego.org

Tags: , ,

Converting from RGB to HSV in OpenCV

I wanted to try some stuff increasing the saturation of a Kinect capture and for that I needed to convert from RGB to HSV the image. I discovered that the OpenCV function for that only uses values between 0 to 179 and not from 0 to 255. This leads to losing information as we can read here.

To avoid that, in that same link they have created two functions to do this change without losing anything:
Read the rest of this entry »

Tags: , , ,