Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all 49 articles
Browse latest View live

Flip video file i

$
0
0
Hi, I am having a hard time making my python code execute with ```rosrun```. My project structure looks like this: ```~/workspace/src/my_package``` which contains two subdirectories with my code, lets say ```a``` with contains ```main.py``` and ```b``` with contains ```b.py```. Each folder contains (```my_package```, ```a``` and ```b```) contains a ```__init__.py```. In ```main.py```, I have ```from b.b import ClassName``` When I try to run my module with ```rosrun my_package main.py```, I get the following error: "ImportError: No module named b" I have a setup.py at the root of ```my_package```: #!/usr/bin/env python # ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup # fetch values from package.xml setup_args = generate_distutils_setup( packages=['my_package'], package_dir={'': 'src'} ) setup(**setup_args) I also added the line in the CMakeLists.txt that execute it. Any ideas? Thank you

Can't find binary when building with Eclipse

$
0
0
Hi! I followed the instructions on how to work with Eclipse and I have successfully imported the project to eclipse and I have no errors. I also managed to build the project with no errors. But when I try to run it, I receive an error that `no binary file was found` and when I try to create a new run configuration, I don't see any binary in the 'search project' option. Any ideas?

Import a floor plan gazebo 2.2

$
0
0
Hi Ros users: Is there any way to import a floor plan in gazebo 2.2 on 2d view? I know that in gazebo 5.0 it is possible how you can see in this tutorial http://gazebosim.org/tutorials?tut=building_editor&cat=build_world but i dont know in gazebo 2.2 if it is possible. Thanks!!!

ImportError: No module named rospkg

$
0
0
Hey, I'm trying to compile a rospackage, but I throws the following error: > ImportError: No module named rospkg I checked if it is installed: > sudo apt-get install python-rospkg -> python-rospkg is already the newest version.> dpkg -L python-rospkg -> /usr/lib/python2.7/dist-packages And if that is in my python path: > echo $PYTHONPATH> -> /home/ruud/Dropbox/ros/catkin_workspace/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages:/usr/lib/pymodules/python2.7:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/rospkg:/usr/lib/python2.7/dist-packages The problem looks very similar to [http://answers.ros.org/question/44669/fuerte-no-module-named-rospkg/](http://answers.ros.org/question/44669/fuerte-no-module-named-rospkg/) As far as I see 'rospkg' is **not** inside /usr/lib/pymodules/python2.7 Help! :) Ruud

Problem inserting STL or scene object in RViz

$
0
0
Hello everyone, I am currently working on a project with the robot Hiro and would like some advices with RViz. **I use ROS Hydro, on Ubuntu 12.04 (64-bit)** I would like to change the robot tools sometime, so I tried to import new 3D models with the Scene Objects-Import File button but I could not load any. With the rqt console I saw an error saying that the needed format was .scene **[Assimp reports no scene in file:///...]** ![alt text](http://s30.postimg.org/5p86np5n5/Screenshot_from_2015_10_21_12_33_51.png "Motion Planning tab") My questions are the following: -Many people here on ros.org said they used STL (binary, not solid works made) or DAE or OGRE format but I don't understand if the files were used directly or somehow "compiled" in a scene. -I have a scene (my workspace); can I add directly a new item (tool) with RViz (I understand it would be done temporary, until RVizz and MoveIt restart) or should I add it directly to the .scene file? -The last thing is about the Import File button I talked about before. Every time I tried to import something (.scene or STL or...) it didn't work. Does it only import objects already in the loaded scene? I think there are already some threads about it but all the links are dead, most of the time, so here we are. Tank you for your advice/ questions ( DO NOT HESITATE if you need more information or if you have the same problem and you want to add a comment or precise a specific case) and thank you for your help! Have nice day :)

catkin_mak

$
0
0
Hello all. I trying to do the tutorial [Writing a Simple Action Server using the Execute Callback (Python)](http://wiki.ros.org/actionlib_tutorials/Tutorials/Writing%20a%20Simple%20Action%20Server%20using%20the%20Execute%20Callback%20%28Python%29) from the actionlib_tutorials. I am trying to finish the first step which is [Creating the Action Messages](http://wiki.ros.org/actionlib_tutorials/Tutorials/SimpleActionServer%28ExecuteCallbackMethod%29#actionlib_tutorials.2BAC8-Tutorials.2BAC8-SimpleActionServer.28ExecuteCallbackMethod.29.2BAC8-groovy.Creating_the_Action_Messages). I followed strictly the instructions, but when I ran the command catkin_make (the last instruction from the step) I got the error exposed bellow. I checked if I have the python's module **em** installed, and I do have. I tried to updated, but did not work. I also read old posters about similar issue, but they did not help me either. Some one could give me any clue on how to solve this problem?>catkin_make Base path: /home/randerson/Dropbox/ros/tutorial_ws Source space: /home/randerson/Dropbox/ros/tutorial_ws/src Build space: /home/randerson/Dropbox/ros/tutorial_ws/build Devel space: /home/randerson/Dropbox/ros/tutorial_ws/devel Install space: /home/randerson/Dropbox/ros/tutorial_ws/install>\####>\#### Running command: "make cmake_check_build_system" in "/home/randerson/Dropbox/ros/tutorial_ws/build">\####>\####>\#### Running command: "make -j4 -l4" in "/home/randerson/Dropbox/ros/tutorial_ws/build"> \####>[ 0%] Built target actionlib_msgs_generate_messages_lisp>[ 0%] Built target _learning_actionlib_generate_messages_check_deps_FibonacciGoal>[ 0%] Built target _learning_actionlib_generate_messages_check_deps_FibonacciResult>[ 0%] [ 0%] Built target _learning_actionlib_generate_messages_check_deps_FibonacciActionGoal>Built target _learning_actionlib_generate_messages_check_deps_FibonacciAction>[ 0%] Built target std_msgs_generate_messages_lisp>[ 0%] Built target actionlib_msgs_generate_messages_cpp>[ 0%] Built target std_msgs_generate_messages_cpp>[ 0%] Built target _learning_actionlib_generate_messages_check_deps_FibonacciActionResult>[ 0%] [ 0%] Built target std_msgs_generate_messages_py>[ 0%] Built target _learning_actionlib_generate_messages_check_deps_FibonacciFeedback>Built target _learning_actionlib_generate_messages_check_deps_FibonacciActionFeedback>[ 0%] Built target actionlib_msgs_generate_messages_py>[ 31%] Built target learning_actionlib_generate_messages_lisp>[ 36%] [ 40%] [ 45%] Generating C++ code from learning_actionlib/FibonacciResult.msg>[ 81%] Generating C++ code from learning_actionlib/FibonacciAction.msg>Built target learning_actionlib_generate_messages_py>Generating C++ code from learning_actionlib/FibonacciFeedback.msg>[ 86%] Traceback (most recent call last):> File "/opt/ros/indigo/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in > import genmsg.template_tools> File "/opt/ros/indigo/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in > import em>ImportError: No module named em>make[2]: *** [/home/randerson/Dropbox/ros/tutorial_ws/devel/include/learning_actionlib/FibonacciResult.h] Error 1>make[2]: *** Waiting for unfinished jobs....>Generating C++ code from learning_actionlib/FibonacciActionResult.msg>Traceback (most recent call last):> File "/opt/ros/indigo/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in > import genmsg.template_tools> File "/opt/ros/indigo/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in > import em>ImportError: No module named em>make[2]: *** [/home/randerson/Dropbox/ros/tutorial_ws/devel/include/learning_actionlib/FibonacciAction.h] Error 1>Traceback (most recent call last):> File "/opt/ros/indigo/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in > import genmsg.template_tools> File "/opt/ros/indigo/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in > import em>ImportError: No module named em>make[2]: *** [/home/randerson/Dropbox/ros/tutorial_ws/devel/include/learning_actionlib/FibonacciFeedback.h] Error 1>Traceback (most recent call last):> File "/opt/ros/indigo/share/gencpp/cmake/../../../lib/gencpp/gen_cpp.py", line 41, in > import genmsg.template_tools> File "/opt/ros/indigo/lib/python2.7/dist-packages/genmsg/template_tools.py", line 39, in > import em>ImportError: No module named em>make[2]: *** [/home/randerson/Dropbox/ros/tutorial_ws/devel/include/learning_actionlib/FibonacciActionResult.h] Error 1>make[1]: *** [learning_actionlib/CMakeFiles/learning_actionlib_generate_messages_cpp.dir/all] Error 2>make: *** [all] Error 2>Invoking "make -j4 -l4" failed**

ImportError: No module named rospy

$
0
0
When I roslaunch my node, the error I receive is ImportError: No module named rospy But when I open up the python environment and run `import rospy`, it imports successfully and I can access `rospy.__file__`, which returns /opt/ros/indigo/lib/python2.7/dist-packages/rospy/__init__.pyc which is on my PYTHONPATH: declare -x PYTHONPATH="/usr/lib/python2.7/dist-packages:/home//indigo_ws/devel/lib/python2.7/dist-packages:/opt/ros/indigo/lib/python2.7/dist-packages" I do have a custom installation of Python that seems to have messed up some catkin_pkg installation, which is why it's had to be appended to the path. When I remove it to run roslaunch as a debug, I just get the same error. Running Ubuntu 14.04 on a Raspberry Pi, if that helps.

Linking external library in ROS Python

$
0
0
Hi, I'm trying to add an external python library to my python project in my catkin workspace. The folder structure is not the best but I have my python executable in the `/scripts` folder along with my library `.so` files. I then import the library using the standard `import` statement. It works fine when I run the executable using `rosrun` but not when I use `roslaunch`. Using roslaunch, the library is not found when the node runs. Any ideas on how to tell roslaunch where to find the library?

Python import: rosrun works well but roslaunch reports error

$
0
0
Hi, I'm writing some rospy nodes recently and some import errors ocur when I utilize roslaunch to start my node.
a.py
1 import sys
2 sys.path.append("..")
3 from middle_abstraction.function_unit import FunctionUnit
ImportError: No module named middle_abstraction.function_unit

The file is organized as following
package
    scripts
       basic_support
          a.py
      middle_abstraction
          function_unit.py
When I cd to basic_support and run python a.py, everthing is working well as well as when I utilize rosrun pkg a.py. But when I utilize roslaunch, this error ocurs. I have written one setup.py file in my pkg folder:
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD

from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup

# fetch values from package.xml
setup_args = generate_distutils_setup(
    packages=['multi_robot_patrol'],#my pkg name
    package_dir={'': 'src'},
    requires=['std_msgs', 'rospy', 'message_filters', 'gps_common', 'sensor_msgs']
)

setup(**setup_args)
I'm really confused that rosrun works pretty well but roslaunch reports import error. I'd appreciate it if anyone can help me.

Import command not working

$
0
0
This is the first part of my code: #!/usr/bin/env python import os import sys import signal import rospy import time Even then I got the error saying that: line 1:#!/usr/bin/env: no such file or directory line 3: import command not found how ever it is working normally when I run with Python Before running it I even did this source ~/catkin_ws/devel/setup.bash

Can't import rospy

$
0
0
Hello, I have a ROS aplication in Python and Qt, and when I run it from the terminal all is ok, but I try to run with double click (the script with the permissions and Nautilus configuration appropriate) and the aplication can't import rospy. I use ROS Indigo and Ubuntu 14.04. Any idea? thanks!

import select ImportError: No module named select

$
0
0
Since yesterday I've been having a problem to use the next command:> $ rospack depends1 rospy And any other command like this. I receive the next output: > $ rospack depends1 rospy>> failed to load symbols, rosdep will> not function properly Cannot import> rospkg, rosdep will not function> properly Traceback (most recent call> last): File> "/usr/lib/pymodules/python2.7/rosdep2/rospack.py",> line 37, in > import subprocess File "/usr/lib/python2.7/subprocess.py",> line 429, in > import select ImportError: No module named select Error in> sys.excepthook: Traceback (most recent> call last): File> "/usr/lib/python2.7/dist-packages/apport_python_hook.py",> line 61, in apport_excepthook> from io import StringIO File "/usr/lib/python2.7/io.py", line 51,> in > import _io ImportError: /usr/lib/python2.7/lib-dynload/_io.so:> undefined symbol:> PyUnicodeUCS4_EncodeUTF32>> Original exception was: Traceback> (most recent call last): File> "/usr/lib/pymodules/python2.7/rosdep2/rospack.py",> line 37, in > import subprocess File "/usr/lib/python2.7/subprocess.py",> line 429, in > import select ImportError: No module named select Traceback (most> recent call last): File> "/usr/lib/pymodules/python2.7/rosdep2/rospack.py",> line 37, in > import subprocess File "/usr/lib/python2.7/subprocess.py",> line 429, in > import select ImportError: No module named select Error in> sys.excepthook: Traceback (most recent> call last): File> "/usr/lib/python2.7/dist-packages/apport_python_hook.py",> line 61, in apport_excepthook> from io import StringIO File "/usr/lib/python2.7/io.py", line 51,> in > import _io ImportError: /usr/lib/python2.7/lib-dynload/_io.so:> undefined symbol:> PyUnicodeUCS4_EncodeUTF32>> Original exception was: Traceback> (most recent call last): File> "/usr/lib/pymodules/python2.7/rosdep2/rospack.py",> line 37, in > import subprocess File "/usr/lib/python2.7/subprocess.py",> line 429, in > import select ImportError: No module named select [rospack] Error:> could not find python module> 'rosdep2.rospack'. is rosdep> up-to-date (at least 0.10.4)? I'm using Ubuntu 12.10 (Quantal), with ROS-HYDRO. My rosdep version is: > $ rosdep --version> 0.10.25 I've already tried to find some solution, but I couldn't. I've tried to 'autoremove' ros and clean install again, but nothing changed. When I try to 'import select' using the python environment in terminal, everything is OK. My PYTHONPATH is OK, as follows: > $ echo $PYTHONPATH > /home/usr/catkin_ws/devel/lib/python2.7/dist-packages:/opt/ros/hydro/lib/python2.7/dist-packages Can anybody help me please?

Import error: no module named Num.msg

$
0
0
Hi, I want to use my own msg, and try this: from Num.msg import * and get the import error. Num.msg is in /msg/ and is found by "rosmsg show". When I don't import, codeline "a = Num()" gets error "Global name 'Num' is not defined". What do I miss? Thanks, hvn

write my own urdf, define visual and collision

$
0
0
as for most realistic robots, the visual or collision part of them are too far complicated to manually write. Someone with experience said using sw_urdf_exporter has several disadvantages so that he would rather write by his own. He said **including the below disadvantages**: 1, **model without texture, one can only specify one color of one whole part of robot**( But I notice that sw_urdf_export tutorial mentions that it can export texture and there is texture folder after complete export. So, if I add texture in SW, will the texture be exported? However, he said he never use texture with sw_urdf_exporter) 2, it often goes wrong with dual arm robot (tree sturcture) 3, can not applied to parallel robot 4, visual model and collision model are the same 5, easy to introduce unnecessary error, which are not identical to design parameters. ---------- I would like to know, if I write a urdf on my own, if the most critical part is writing the origin between joints and links, then as for **visual part and collision part**, actually they could be **dae file** exported by **blender**. **Here are the two optional processes:** 1, a) break solidworks models into parts or sub-assemblies, set reference coordinate systems and axes for them. b) save as iges file c) import to 3d max, export dae file d) import to blender, modify units and coordinates which are corresponding to the description in urdf, save as dae file. done 2, like **gazebo tutorial** says, [model apperance](http://gazebosim.org/tutorials?tut=guided_i2) a) step file imported to freecad, freecad exports dae file b) import to blender, modify units and coordinates which are corresponding to the description in urdf , save as dae file. done I wonder if what I perceive is right? Or, could u pls give me recommendations?

Unable to import python script from a second package

$
0
0
I am attempting to import a python script which is part of a second package. The code for my project is located at https://github.com/Aditya90/zeroborgRobot/tree/feature/AddZeroborgLibrary. In the file `node_zeroborg_output.py`, I am attempting to import the `zeroborg_output.zeroborg` script which has the `ZeroBorg` class. When I try running `node_zeroborg_output`in the package `robot_motion_control`, I get the following error ``` ImportError: No module named zeroborg_support.zeroborg ``` I am new to ROS, so I might be missing something obvious. Thank you for the help.

Executable programm using ros (double click)

$
0
0
Hello, I have a c++ programm that starts a launchfile with exec (same result if i start it with system). It does work fine when starting from the terminal. However, I would like to have it execute on double click. I created a .desktop file: [Desktop Entry] Version=1.0 Name=filename Comment=File to make filename executable Exec=/path/to/file Icon=/path/to/icon.png Terminal=true Type=Application Categories=Applications But when I start the programm I only get: Traceback (most recent call last): File "/opt/ros/kinetic/bin/roslaunch", line 34, in import roslaunch ImportError: No module named roslaunch

import error no module named srv

$
0
0
I am struggling to progress the error (below) which I have encountered when completing this part of the tutorial [link text](http://wiki.ros.org/ROS/Tutorials/ExaminingServiceClient) I'm not sure why the script I have literally copied over won't work. I have spent an hour or so trying to figure it out but can't solve it.. The code message: danny@danny:~/catkin_ws$ rosrun beginner_tutorials add_two_ints_server.py Traceback (most recent call last): File "/home/danny/catkin_ws/src/beginner_tutorials/scripts/add_two_ints_server.py", line 3, in from beginner_tutorials.srv import * ImportError: No module named srv danny@danny:~/catkin_ws$

cannot import libfreenect2

$
0
0
I have followed the steps for the installation of libfreenect2 as given in this link (https://github.com/OpenKinect/libfreenect2)(on Ubuntu 14.04.1) i have installed it at /home/user_name/ i have to import freenect2 just like this https://rjw57.github.io/freenect2-python/ But i'm not able to import freeenct2 and it gives me this error:>>> import freenect2 Traceback (most recent call last): File "", line 1, in ImportError: No module named freenect2 Or do i have any other option....

importing rospy and actionlib causes embedding python code in c++ to fail

$
0
0
Hi, I am using a large code base were our robot path planning is entirely coded in python. We need to call the planner in one c++ code file to find the path length. I have tested my code with other python scripts and it compiles and works well. However, when calling a function from a python file that is a rosnode and imports rospy and actionlib, the returned object from the python code in c++ is NULL. I am guessing rospy must be the problem here. Any ideas about what could be causing this and what could be the solution? Thanks a lot, Zeynab

Ros python packages __init__ level imports

$
0
0
I noticed that in native ROS packages all available modules seem to be imported at package level always. For example let us consider the `rosbag` python package. This is the output I see when print the list of modules imported at package-level.>>> import rosbag>>> dir(rosbag) ['Bag', 'Compression', 'ROSBagException', 'ROSBagFormatException', 'ROSBagUnindexedException', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', 'bag', 'migration', 'rosbag_main', 'rosbagmain'] However the `__init__.py` file of rosbag package does not explicitly import `bag`, `migration` and `rosbag_main`. How are these these modules getting imported by themselves? In order to verify if this is something done by the catkin build system, I wrote my own ros python package. My custom package did't have the modules imported at package level. So my question is what makes the ROS native python packages special to cause this behavior? In order to understand this question better, if you want to access the rosbag source, see the link https://github.com/ros/ros_comm/tree/lunar-devel/tools/rosbag/src/rosbag
Viewing all 49 articles
Browse latest View live