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

i got problems with roslaunch learning_nxt robot.launch

asked 2017-11-14 22:04:14 -0500

luisitomzt gravatar image

updated 2017-11-16 12:59:30 -0500

i got this error when i try this command on console :

$ roslaunch learning_nxt robot.launch

process[nxt_ros-2]: started with pid [23000] 

Traceback (most recent call last):

  File "/home/luis/nxt/src/nxt_ros/src/nxt_ros/nxt_ros.py", line 37, in <module>
    import nxt.locator

ImportError: No module named nxt.locator

Update:

i'll describe the process to create the package first at home directory:

mkdir nxt
cd nxt
git clone --recursive https://github.com/NXT-ROS/nxt.git src

then on the root of the package directory

catkin_make (everything goes fine)
source devel/setup.bash

until this point everything is ok

then when i try this:

roslaunch nxt_ros_test test.launch

or

roslaunch learning_nxt robot.launch

both have the same problem

edit retag flag offensive close merge delete

Comments

Welcome! What version of ROS are you using and what OS? Can you please provide a link to the package that you're using? Is it this nxt_ros? Are you using a simulator or a physical robot?

jayess gravatar image jayess  ( 2017-11-15 01:29:19 -0500 )edit

@luisitomzt: I moved your updated info to your question, but in the future please don't use an answer to give more info about your question

jayess gravatar image jayess  ( 2017-11-15 16:15:47 -0500 )edit

I'm a little confused by this new info. Are you using a catkin workspace? Or, are you just doing everything from a regular folder that you created in your home directory?

jayess gravatar image jayess  ( 2017-11-15 16:16:46 -0500 )edit

i created a folder in home/my user/ called “nxt”. Then in this folder I cloned nxt_ros using the command I mentioned before. By executing catkin_make the folder I created becomes a catkin workspace isn’t it?

luisitomzt gravatar image luisitomzt  ( 2017-11-15 17:59:40 -0500 )edit

Yes, but you need to put your packages in the src folder inside the workspace. Checkout my updated answer and let me if it helps/you need further clarification.

jayess gravatar image jayess  ( 2017-11-15 18:31:26 -0500 )edit

So, I took a look at the README and it says that you need to use catkin buildnotcatkin_make. This could be the source of your problem.

jayess gravatar image jayess  ( 2017-11-15 18:40:05 -0500 )edit

i installed python-catkin-tools for using catkin build. then erased the nxt workspace and make it again for a clean installation. i followed the steps i mentioned before, but the problem persist.

luisitomzt gravatar image luisitomzt  ( 2017-11-15 19:29:46 -0500 )edit

Did you use catkin_make? If so, that is not compatible with catkin build. You can't use catkin_make with catkin_tools. Try again following the instructions in my answer (or the repo's README).

jayess gravatar image jayess  ( 2017-11-15 19:32:16 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2017-11-15 01:35:54 -0500

jayess gravatar image

updated 2017-11-15 19:34:23 -0500

If you're using this version of nxt_ros then you'll need to run catkin_make from the root of the directory and then source your setup.bash to make the Python modules available.

~/catkin_ws/$ catkin_make
~/catkin_ws/$ source devel/setup.bash

Or, you haven't downloaded/compiled/installed the package with the required nxt.locator module.


Update:

The README shows that you need to use catkin build to compile. If you're using catkin_make you're going to have issues (as it appears you are) because these two are incompatible (as far as I know). From the README:

~$ mkdir nxt
~$ cd nxt
~/nxt$ git clone --recursive https://github.com/NXT-ROS/nxt.git src
~/nxt$ catkin init # initialize the workspace
~/nxt$ catkin build # build all packages

Take a look at the docs for catkin_tools for more information.

Note: I updated this (again) to reflect the README of the repo.

edit flag offensive delete link more

Comments

i used the package you mentioned, run catkin_make on the root of my workspace, and then sourced setup.bash everything goes fine at this point. then i try to launch the test package with "roslaunch nxt_ros_test test.launch" and the error keep showing. ImportError: No module named nxt.locator

luisitomzt gravatar image luisitomzt  ( 2017-11-15 13:36:11 -0500 )edit

Thank you for you patience, but the nxt_ros package is inside the src folder. It was created when I executed the command “git clone —recursive https://github.com/NXT-ROS/nxt.git src” this created src folder inside ~/nxt folder

luisitomzt gravatar image luisitomzt  ( 2017-11-15 18:36:41 -0500 )edit

Right, I didn't notice the src at the end of your command. I've updated my answer.

jayess gravatar image jayess  ( 2017-11-15 18:41:05 -0500 )edit
0

answered 2017-11-16 12:59:02 -0500

luisitomzt gravatar image

updated 2017-11-17 02:00:22 -0500

i already fixed the problem with the missing module nxt.locator, what i've done to fix the problem is to install the following packages from nxt-python:

version 2.2.2 of nxt-python from here:

and PyBluez, PyUSB and Pyfantom

all installed by executing sudo python setup.py install

By doing that, the missing module nxt.locator problem was solved.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-11-14 22:04:14 -0500

Seen: 275 times

Last updated: Nov 17 '17