ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Adding NaoQI API to the PYTHONPATH

asked 2013-01-21 11:07:21 -0600

JustARandomGuy gravatar image

updated 2014-01-28 17:14:56 -0600

ngrennan gravatar image

Hi there, I am currently using naoQi-sdk-1.14. I am also following the guide: http://www.ros.org/wiki/nao/Tutorials/Getting-Started

I am on the stage: 1.6: Launching ROS and NAOqi

When I execute the command:

LD_LIBRARY_PATH=~/naoqi/naoqi-sdk-1.14-linux32/lib:$LD_LIBRARY_PATH NAO_IP=127.0.0.1 roslaunch nao_driver nao_driver_sim.launch

I get the following error:

"Error importing NaoQI. Please make sure that Aldebaran's NaoQI API is in your PYTHONPATH"

The full output is shown below:

martin@martin-VPCEE2S1E:~$ LD_LIBRARY_PATH=/home/martin/naoqi/naoqi-sdk-1.14-linux32/lib:$LD_LIBRARY_PATH NAO_IP=127.0.0.1 roslaunch nao_driver nao_driver_sim.launch ... logging to /home/martin/.ros/log/3b3e0ce8-641c-11e2-b2a9-78dd08e5b016/roslaunch-martin-VPCEE2S1E-9508.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://martin-VPCEE2S1E:59489/

SUMMARY

PARAMETERS * /nao_sensors/use_joint_sensors * /rosdistro * /rosversion

NODES / nao_controller (nao_driver/nao_controller.py) nao_sensors (nao_driver/nao_sensors.py) nao_walker (nao_driver/nao_walker.py)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading'="" from="" '="" usr="" lib="" python2.7="" threading.pyc'=""> ignored process[nao_walker-1]: started with pid [9528] Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading'="" from="" '="" usr="" lib="" python2.7="" threading.pyc'=""> ignored process[nao_sensors-2]: started with pid [9529] Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading'="" from="" '="" usr="" lib="" python2.7="" threading.pyc'=""> ignored process[nao_controller-3]: started with pid [9530] No handlers could be found for logger "rosout" [ERROR] [WallTime: 1358809992.968376] Error importing NaoQI. Please make sure that Aldebaran's NaoQI API is in your PYTHONPATH. ================================================================================REQUIRED process [nao_walker-1] has died! process has died [pid 9528, exit code 1, cmd /home/martin/my_workspace/nao/stacks/nao_robot/nao_driver/scripts/nao_walker.py --pip=127.0.0.1 --pport=9559 __name:=nao_walker __log:=/home/martin/.ros/log/3b3e0ce8-641c-11e2-b2a9-78dd08e5b016/nao_walker-1.log]. log file: /home/martin/.ros/log/3b3e0ce8-641c-11e2-b2a9-78dd08e5b016/nao_walker-1*.log Initiating shutdown! ================================================================================ Traceback (most recent call last):
File "/home/martin/my_workspace/nao/stacks/nao_robot/nao_driver/scripts/nao_sensors.py", line 46, in <module> from nao_msgs.msg import TorsoOdometry, TorsoIMU ImportError: No module named nao_msgs.msg Traceback (most recent call last): File "/home/martin/my_workspace/nao/stacks/nao_robot/nao_driver/scripts/nao_controller.py", line 46, in <module> import nao_msgs.msg ImportError: No module named nao_msgs.msg [nao_controller-3] killing on exit [nao_sensors-2] killing on exit [nao_walker-1] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done

I have looked at similar questions and answers such as http://answers.ros.org/question/28902/adding-naoqi-api-to-pythonpath-v112/?answer=29878#post-id-29878.

I have added onto my bashrc file - export ROS_PACKAGE_PATH=~/my_workspace/nao:$ROS_PACKAGE_PATH and export PYTHONPATH=~/naoqi/naoqi-sdk-1.14-linux32/lib:$PYTHONPATH but i still get this error :S

Could anyone help please?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-01-21 21:01:41 -0600

AHornung gravatar image

You don't need the naoqi-sdk-X.YY-linux32 but the NaoQI Python SDK for the ROS nodes, starting with NaoQI 1.12. So, don't add it to your LD_LIBRARY_PATH globally in your .bashrc (that may have other dangerous side effects).

You need to have the separate Python SDK in your PYTHONPATH, that alone should be enough. Here is what my entries in .bashrc look like:

export AL_DIR=$HOME/code/Nao/1.12.3
export PYTHONPATH="$PYTHONPATH:$AL_DIR/pynaoqi"

The directory ~/code/Nao/1.12.3/pynaoqi contains the files allib.py, allog.py, naoqi.py etc.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-01-21 11:07:21 -0600

Seen: 3,173 times

Last updated: Jan 21 '13