Difference between revisions of "How to use the real e-pucks with Aseba"

From IridiaWiki
Jump to navigationJump to search
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
  +
Download the files from the SVN repository ([[Get all the files you need]]) then follow this instructions
In order to use the e-puck with Aseba you need to complete several steps: [tested on Ubuntu 9.10 - March 2010]
 
   
  +
Note that sometimes Aseba and the e-puck have a complicated relationship. It looks like Aseba asks too much from the e-puck, and often the e-puck will get grumpy and just block. Aseba is great to prototype, but for a more serious relationship you want to go for pure C. It is way more reliable and it will not break your heart.
First of all you need to retrieve all the necessary files from the svn repository.
 
 
Ask a user to Alessandro (alessandro (dot) stranieri (at) ulb (dot) ac (dot) be) and then do:
 
 
svn checkout https://iridia-dev.ulb.ac.be/projects/epuck_files/svn
 
   
 
==== Download, compile and patch Dashel (v.127) and Aseba (v. 381) ====
 
==== Download, compile and patch Dashel (v.127) and Aseba (v. 381) ====
 
''Fast solution:''
 
''Fast solution:''
* use the script done by Arne (TODO put the path)
+
* use the script done by Arne
 
** copy patches/ and install_aseba.sh to a directory where you want all the files and run the script
 
** copy patches/ and install_aseba.sh to a directory where you want all the files and run the script
   
Line 16: Line 12:
 
:* download Dashel v. 127
 
:* download Dashel v. 127
 
svn -r127 co http://svn.gna.org/svn/dashel/trunk dashel
 
svn -r127 co http://svn.gna.org/svn/dashel/trunk dashel
:* patch it - (TODO this is necessary because... )
+
:* patch it - (this is necessary in order to make Aseba communicate with the simulator )
 
cd dashel
 
cd dashel
 
patch -p0 < patches/dashel_with_fpic_r127.patch
 
patch -p0 < patches/dashel_with_fpic_r127.patch
Line 22: Line 18:
 
cmake .
 
cmake .
 
make
 
make
:* install it in /usr/local (you can avoid this but then you need to modify the CMakeLists.txt in Aseba)
+
:* install it in /usr/local (you can avoid this but then you need to run "ccmake ." or to modify the CMakeLists.txt in Aseba)
 
sudo make install
 
sudo make install
   
Line 38: Line 34:
 
:* test if it works
 
:* test if it works
 
cd studio
 
cd studio
./studio
+
./asebastudio
 
:* a window should appear. You are not able to connect now, it's normal
 
:* a window should appear. You are not able to connect now, it's normal
  +
  +
NOTE: if "asebastudio" is not there, i.e. the file is missing, it means that you don't have the QT4 library installed. Install it and recompile all.
   
 
Now you should have Aseba working under your system ready to communicate with the simulator and the real e-pucks
 
Now you should have Aseba working under your system ready to communicate with the simulator and the real e-pucks
   
==== Bluetooth Configuration ====
+
==== Upload the latest epuckaseba.hex ====
   
  +
If you have modified the epuckaseba.c file (aseba/targets/e-puck) or you think that the e-puck does not have the correct file, you need to upload the epuckaseba.hex file on the robots.
* bluetooth/rfcomm.conf has to be copied in /etc/bluetooth
 
* bluetooth/passwords/ has to be copied in /etc/bluetooth
 
* bluetooth/90-local.rules has to be copied in /etc/udev/rules.d/
 
   
now you have to restart the services
 
sudo /etc/init.d/bluetooth stop
 
sudo /etc/init.d/udev restart (or sudo restart udev)
 
sudo /etc/init.d/bluetooth start
 
   
  +
Follow this instructions: [[How to connect to the robots via bluetooth and upload a file]]
check if in /dev/ there are some files called rfcomm**, if not do:
 
sudo rfcomm bind all
 
 
you should now have all the necessary files to connect to the robots.
 
 
 
NOTE:
 
The above files have been created by us and are not complete. This means that if you want to use an e-puck that is not in the list you should add it.
 
 
To do that you have to first get the MAC address of the epuck you want to add: turn on the selected e-puck and do:
 
hcitool scan
 
modify rfcomm.conf and 90-local.rules using the existing lines as examples.
 
 
As a last step you need to add the password file in the passkeys directory. Go in /etc/bluetooth/passwords/ and do (with the correct epuck number and MAC):
 
echo 'epuck_1442' > '08:00:17:2D:1A:15'
 
 
Once you have done this please update the corresponding file in the svn. Eventually we will be able to have the complete list for all the e-pucks (or, at least, the most used ones)
 
 
==== Upload the .hex file ====
 
 
Once you are able to connect to the robot you have to upload the file to the Epuck.
 
 
In epuck-uploader/ there is a script to upload a file to the E-puck. To do it just write:
 
./epuckupload -f filename **
 
where filename is the name of the file to upload (normally epuckaseba.hex) and ** is the number of the robot to update (e.g. 42)
 
 
when a series of dots are printed on the screen press the reset button of the e-puck and the upload should begin (a series of * are printed)
 
 
you are ready to connect the robot to Aseba
 
   
 
==== Connect the robot to Aseba ====
 
==== Connect the robot to Aseba ====
Line 91: Line 55:
 
where **** is the number of the epuck
 
where **** is the number of the epuck
   
  +
If everything is fine aseba should be opening up.
If everything is fine aseba should be opening up. Note: if the left menu is not there, there is most probably a mismatch between your aseba version and the one used to compile the hex on the robot. Try to get the latest version or compile a new .hex.
 
  +
 
Note: if the left menu is not there, there is most probably a mismatch with the firmware on the e-puck or between your aseba version and the one used to compile the hex on the robot.
  +
  +
  +
To upload a new firmware follow this guide: [[How to upload a new firmware on the e-puck]]
   
   
Line 97: Line 66:
   
   
If you have any problem or question please send me and e-mail (mbrambilla@iridia.ulb.ac.be) or contact me personally
+
If you have any problem or question please send me an e-mail (mbrambilla@iridia.ulb.ac.be) or contact me personally

Latest revision as of 10:45, 19 October 2011

Download the files from the SVN repository (Get all the files you need) then follow this instructions

Note that sometimes Aseba and the e-puck have a complicated relationship. It looks like Aseba asks too much from the e-puck, and often the e-puck will get grumpy and just block. Aseba is great to prototype, but for a more serious relationship you want to go for pure C. It is way more reliable and it will not break your heart.

Download, compile and patch Dashel (v.127) and Aseba (v. 381)

Fast solution:

  • use the script done by Arne
    • copy patches/ and install_aseba.sh to a directory where you want all the files and run the script

Step-by-step solution:

  • DASHEL
  • download Dashel v. 127
svn -r127 co http://svn.gna.org/svn/dashel/trunk dashel
  • patch it - (this is necessary in order to make Aseba communicate with the simulator )
cd dashel
patch -p0 < patches/dashel_with_fpic_r127.patch
  • compile it
cmake .
make
  • install it in /usr/local (you can avoid this but then you need to run "ccmake ." or to modify the CMakeLists.txt in Aseba)
sudo make install
  • ASEBA
  • download Aseba v. 381
svn -r381 co http://svn.gna.org/svn/aseba/trunk aseba
  • patch it - (this is necessary in order to make Aseba communicate with the simulator )
cd aseba
patch -p0 < patches/aseba_complete_r381.patch
  • compile it
cmake .
make
  • install it in /usr/local
sudo make install
  • test if it works
cd studio
./asebastudio
  • a window should appear. You are not able to connect now, it's normal

NOTE: if "asebastudio" is not there, i.e. the file is missing, it means that you don't have the QT4 library installed. Install it and recompile all.

Now you should have Aseba working under your system ready to communicate with the simulator and the real e-pucks

Upload the latest epuckaseba.hex

If you have modified the epuckaseba.c file (aseba/targets/e-puck) or you think that the e-puck does not have the correct file, you need to upload the epuckaseba.hex file on the robots.


Follow this instructions: How to connect to the robots via bluetooth and upload a file

Connect the robot to Aseba

open aseba and put as connection point "custom":

ser:device=/dev/epuck_****

where **** is the number of the epuck

If everything is fine aseba should be opening up.

Note: if the left menu is not there, there is most probably a mismatch with the firmware on the e-puck or between your aseba version and the one used to compile the hex on the robot.


To upload a new firmware follow this guide: How to upload a new firmware on the e-puck



If you have any problem or question please send me an e-mail (mbrambilla@iridia.ulb.ac.be) or contact me personally