Outils pour utilisateurs

Outils du site


hokuyo

Hokuyo

Noeud ROS

Install sous linux

driver de l'aist dans robotpkg

probleme, il faut modifier 2 fichiers intermediaires

cd /home/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work/gearbox-9.11/src/hokuyo_aist/CMakeFiles/hokuyo_aist.dir
vim link.txt 
/usr/bin/g++  -fPIC    -O3 -DNDEBUG  -Wl,-rpath,/home/bvandepo/openrobots/lib/gearbox  -L/home/bvandepo/openrobots/lib/gearbox -shared -Wl,-soname,libhokuyo_aist.so.1.0.0 -o libhokuyo_aist.so.1.0.0 CMakeFiles/hokuyo_aist.dir/hokuyo_aist.o -lflexiport -Wl,-rpath,:::::::::::::::::::::::::::::::::::::

et

cd /home/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work/gearbox-9.11/src/hokuyo_aist/test/CMakeFiles/hokuyo_aist_example.dir
vim link.txt 
/usr/bin/g++      -O3 -DNDEBUG  -fPIC  -Wl,-rpath,/home/bvandepo/openrobots/lib/gearbox -L/home/bvandepo/openrobots/lib/gearbox  CMakeFiles/hokuyo_aist_example.dir/example.o  -o hokuyo_aist_example -rdynamic ../libhokuyo_aist.so.1.0.0 -lflexiport -Wl,-rpath,/home/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work/gearbox-9.11/src/hokuyo_aist
programme d'exemple

dans /home/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work/gearbox-9.11/src/hokuyo_aist/test

pour faire mon soft, copier le fichier example.cpp, et il faudra linker mon projet avec

/home/bvandepo/openrobots/lib/gearbox/libhokuyo_aist.so
/home/bvandepo/openrobots/include/gearbox/hokuyo_aist/hokuyo_aist.h

ajouter ce dossier pour la recherche des fichiers .h /home/bvandepo/openrobots/include/gearbox/

ajouter le dossier des librairies dans le ~/.tcshrc

setenv LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:/home/bvandepo/openrobots/lib/gearbox"

dans le projet qtcreator, ajouter au fichier .pro

INCLUDEPATH +=/home/bvandepo/openrobots/include/gearbox/
LIBS += -L/home/bvandepo/openrobots/lib/gearbox -lhokuyo_aist

Utilisation du device

creer lien symbolique pour avoir le device qui s'appelle /dev/ttyACM0

sudo ln -ls /dev/ttys000 /dev/ttyACM0

dire qu'il m'appartient

sudo chown -vR bvandepo /dev/ttyACM0

donner les droits en lecture

   sudo chmod -vR +r  /dev/ttyACM0
   

sur borderouge

~/openrobots/share/OpenRTM-aist/examples    
~/robotpkg/hardware/gbx-hokuyo-aist

gestion des droits d'acces au periph

dmesg
usb 4-2: new full speed USB device using uhci_hcd and address 3
usb 4-2: configuration #1 chosen from 1 choice
cdc_acm 4-2:1.0: ttyACM0: USB ACM device
usb 4-2: New USB device found, idVendor=15d1, idProduct=0000
usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 4-2: Product: URG-Series USB Driver
usb 4-2: Manufacturer: Hokuyo Data Flex for USB

configurer udev

sudo vim /etc/udev/rules.d/99-hokuyo.rules
# hokuyo rules
SYSFS{idVendor}=="15d1", SYSFS{idProduct}=="0000", MODE="0666", OWNER="root", GROUP="root"

apres quoi:

ls -la /dev/ttyA*

indique que le periph est lisible par tout le monde

crw-rw-rw- 1 root root 166, 0 2010-04-14 18:31 /dev/ttyACM0

MAC

sur le mac le device hokuyo est

/dev/tty.usbmodem411

install de robotpkg

git clone ssh://bvandepo@softs.laas.fr/git/robots/robotpkg
cd robotpkg/
cd bootstrap/
./bootstrap --prefix ~/openrobots
vim ~/.login

ajouter dans le path les dossiers des binaires d'openrobots (a faire peut etre tt le temps dans .bashrc)

export PATH=${PATH}:/Users/bvandepo/openrobots/sbin:/Users/bvandepo/openrobots/bin

probleme, il faut modifier 2 fichiers intermediaires

cd /home/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work/gearbox-9.11/src/hokuyo_aist/CMakeFiles/hokuyo_aist.dir
vim link.txt 

/usr/bin/g++   -mmacosx-version-min=10.5    -O3 -DNDEBUG -dynamiclib -headerpad_max_install_names -L/Users/bvandepo/openrobots/lib/gearbox   -compatibility_version 1.0.0 -current_version 1.0.0 -o libhokuyo_aist.1.0.0.dylib -install_name /Users/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work/gearbox-9.11/src/hokuyo_aist/libhokuyo_aist.1.0.0.dylib CMakeFiles/hokuyo_aist.dir/hokuyo_aist.o -lflexiport
cd /home/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work/gearbox-9.11/src/hokuyo_aist/test/CMakeFiles/hokuyo_aist_example.dir
vim link.txt 
/usr/bin/g++    -mmacosx-version-min=10.5    -O3 -DNDEBUG -Wl,-search_paths_first -headerpad_max_install_names  -L/Users/bvandepo/openrobots/lib/gearbox    CMakeFiles/hokuyo_aist_example.dir/example.o  -o hokuyo_aist_example  ../libhokuyo_aist.1.0.0.dylib -lflexiport

~

ca compile mais probleme à l'execution de

/Users/bvandepo/openrobots/bin/hokuyo_aist_example
dyld: Library not loaded: libhokuyo_aist.1.0.0.dylib
  Referenced from: /Users/bvandepo/openrobots/bin/hokuyo_aist_example
  Reason: image not found
Trace/BPT trap

faire

man dyld

il faut régler DYLD_LIBRARY_PATH

export DYLD_LIBRARY_PATH=/Users/bvandepo/openrobots/lib/gearbox
 

ce qu'il faudrait faire pour utiliser ~/.bashrc : (http://www.smarinier.net/blog/index.php?2008/09/29/38-lancer-le-bashrc-sous-mac-automatiquement)

vim ~/.bash_profile  : pour l'avoir que dans la console
vim ~/.profile       : pour l'avoir partout (y compris qtcreator)
export PATH=${PATH}:/Users/bvandepo/openrobots/sbin:/Users/bvandepo/openrobots/bin
export DYLD_LIBRARY_PATH=/Users/bvandepo/openrobots/lib/gearbox

creer lien symbolique pour avoir le device qui s'appelle /dev/ttyACM0

sudo ln -s  /dev/tty.usbmodem411  /dev/ttyACM0

dire qu'il m'appartient

sudo chown -vR bvandepo /dev/ttyACM0

donner les droits en lecture

   sudo chmod -vR +r  /dev/ttyACM0
projet avec qtcreator

pour pouvoir executer le programme depuis qtcreator (sans console) et pouvoir débugger, il faut définir la variable d'environnement dans le projet

Projet→ Environnement d'execution →Environnement du systeme→ajouter

nom: DYLD_LIBRARY_PATH

valeur: /Users/bvandepo/openrobots/lib/gearbox/ (ne pas oublier le dernier /)

pour le fichier .pro, il faut utiliser:

INCLUDEPATH +=/Users/bvandepo/openrobots/include/gearbox/
LIBS += -L/Users/bvandepo/openrobots/lib/gearbox -lhokuyo_aist

modif du driver

modifier les sources dans /Users/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work.garossos-wifi.laas.fr/gearbox-9.11/src/hokuyo_aist puis la premiere fois dans /Users/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/ faire:

make  confirm
make replace confirm

les fois suivantes, aller dans /Users/bvandepo/robotpkg/hardware/gbx-hokuyo-aist/work.garossos-wifi.laas.fr/gearbox-9.11/src et faire juste

make install

il y a un probleme pour acquérir les intensités, j'ajoute en ligne 1638 de hokuyo_aist.cpp, pour ne comparer que les 12 caractères au lieu des 13:

//bvdp 
/*
printf("buffer :    ");
for (int ii=0;ii<14;ii++)
printf("%c",buffer[ii]);
printf("\n");
printf("response :");
for (int ii=0;ii<17;ii++)
printf("%c",response[ii]);
printf("\n");
*/
//
// Check the echo is correct
  if (response[0] != 'M' || response[1] != 'E')
  {
  stringstream ss;
  ss << "Incorrect data 	: ME" << " != " << response[0] << response[1];
  throw HokuyoError (HOKUYO_ERR_PROTOCOL, ss.str ());
  }
// Then compare the parameters
//		if (memcmp (&response[2], buffer, 13) != 0)
//bvdp
if (memcmp (&response[2], buffer, 12) != 0)
hokuyo.txt · Dernière modification : 2021/02/19 21:20 de 127.0.0.1