Hi,
There is a problem with importing
"import org.ros.rosjava.android.MessageCallable;"
"import org.ros.rosjava.android.views.RosTextView;"
which are part of the android library into the MainActivity.java inside the android project.
The project uses rosjava.jar which contains necessary java files to build; However, there is a difficulty with incorporating the android library into the project?
I am not that knowledgeable with using the android library together with rosjava. Can you advise on how to get this done?
Thank you!
Soe
↧
Error importing android library into android project using rosjava.jar
↧
Tutorial 15 - ExaminingServiceClient(python)
I've gone through the previous tutorials and am now having a problem with running the server. After entering "rosrun beginner_tutorials add_two_ints_server.py" in the commmand line, I'm receiving the following error:
...
line 4, in
from beginner_tutorials.srv import *
ImportError: No module named beginner_tutorials.srv
↧
↧
Why import complicated stl file will caused problem on gazebo?
My cad translate to stl file is
![image description](/upfiles/1313242846628420.png)
I use meshlab to view it:
![image description](/upfiles/1314004515201303.jpg)
But when I import to gazebo.
sam@/home/sam/code/ros/gazebo/stl$ rosrun gazebo spawn_model -file `pwd`/foot.urdf -urdf -model foot_model -z 100.5
loading model xml from file
attempting to spawn robot in simulation
waiting for service spawn_urdf_model
spawn status: SpawnModel: successfully spawned model
spawning success True
sam@/home/sam/code/ros/gazebo/stl$
The model seems very weird even broken to parts.
![image description](/upfiles/13132429621970254.jpg)
How to solve it? Thank you~~
↧
Can't import STL file into gazebo
Hello,
I can't seem to create STL files that gazebo will accept. I have tried exporting stl files from Autodesk Inventor 2012, Solidworks 2011 and Pro/Engineer wildfire 5.0. For testing purposes I have been exporting a simple rectangular prism and using the spinning top tutorial. If it is helpful I can upload the .stl files I was using. Does anybody know what I am doing wrong?
Thanks in advance
Brian
↧
Import .dae Gazebo-1.0.0-RC2
Hello, I know there are more threads like here: http://answers.ros.org/question/11013/importing-collada-meshes-into-a-gazebo-world
or
http://answers.ros.org/question/1862/gazebo-world-file-from-a-collada-file
or
http://answers.ros.org/question/2914/create-rough-terrain-for-used-in-gazebo
but my problem is the next:
I have a few models in collada with their images in the follow distribution (for example):
chair3
-images
-----DSCI0887noCulling.jpg
-----Wood_Bamboo_LightnoCulling.jpg
-----Wood_CherrynoCulling
-model
-----chair.dae
-----chair.stl
-doc.kml
-textures.txt
ok inside model/chair.dae I have:
.
.
.
.
../images/Wood_CherrynoCulling.jpg ../images/Wood_Bamboo_LightnoCulling.jpg ../images/DSCI0887noCulling.JPG
.
.
.
.
but my problem is: How I imoport to gazebo ChairColladaWorld.world the chair.dae?
I try with:
5.0 -5.0 0.1 0 0 0 true 1.0 1.0 1.0 chair.dae 1.0 1.0 1.0 chair.dae
But it seems like the sytaxis is old, I can't find more examples and I need a little help here.
I try with:
1.0 1.0 1.0 chair.dae 1.0 1.0 1.0 chair.dae
But I think I am doing something wrong.
Of course, I try with:
export GAZEBO_RESOURCE_PATH=~/models/chair3/model
With that export, I think is enough to Gazebo to find the path to the model .dae and their images.
errors lunching:
$ gzserver ChairColladaWorld.world
Gazebo multi-robot simulator, version 1.0.0-RC2
Copyright (C) 2011 Nate Koenig, John Hsu, Andrew Howard, and contributors.
Released under the Apache 2 License.
http://gazebosim.org
Error [parser.cc:520] XML Element[model:physical], child of element[world] not defined in SDF. Ignoring.[world]
Error [parser.cc:511] Error reading element
Error [parser.cc:313] Unable to parse sdf element[gazebo]
Warning [parser.cc:235] parser for sdf version 1.0 failed, trying to parse as old deprecated format
namespace error : Namespace prefix model on physical is not defined
^
namespace error : Namespace prefix body on trimesh is not defined
^
namespace error : Namespace prefix geom on trimesh is not defined
^
Entity: line 63: parser error : Opening and ending tag mismatch: world line 3 and gazebo
^
Entity: line 65: parser error : Premature end of data in tag gazebo line 2
^
Error [parser_deprecated.cc:1210] Could not parse the xml
Warning [parser.cc:241] parsing using deprecated world file failed trying old model format.
namespace error : Namespace prefix model on physical is not defined
^
namespace error : Namespace prefix body on trimesh is not defined
^
namespace error : Namespace prefix geom on trimesh is not defined
^
Entity: line 63: parser error : Opening and ending tag mismatch: world line 3 and gazebo
^
Entity: line 65: parser error : Premature end of data in tag gazebo line 2
^
Error [parser_deprecated.cc:1151] Could not parse the xml
Error [parser.cc:247] parse as old deprecated model file failed.
Error [Server.cc:75] Unable to read sdf file[ChairColladaWorld.world]
Error [server_main.cc:116] Could not open file[ChairColladaWorld.world]
Ok, after a lot of work in this issue, I finish find the solution:
In the ___.world it is necessary:
.
.
.
But the next question is: how I load the textures and the materials? because the line:
Load the gazebo script and not the image file found in the .dae
How could I change or tell Gazebo where is load the file in format .jpg or .png??
I see in the .dae this lines:
../images/Wood_CherrynoCulling.jpg ../images/Wood_Bamboo_LightnoCulling.jpg ../images/DSCI0887noCulling.JPG
But doesn't load :(
Could anybody help me?
Thanks!!
Thanks!!
Thanks!!
↧
↧
import a 'roshlet' from another roshlet
Hi,
If I have two rosh scripts - lets say a.py and b.py that work perfectly when invoked independently (rosrun rosh rosh a.py) - is there a simple mechanism for importing one into the other that ensures the globals() have been set up during the import.
e.g.,
#### b.py #### def getpoint(): return msg.geometry_msg.PointStamped() #### a.py #### import b actions.foo_controller.move_to(b.getpoint())The problem is that if I 'rosrun rosh rosh a.py', global variables like msg, actions, etc in module a are set up but these do not carry across when I 'import b'. As a result, b will not load (with an error the msg is not defined).
↧
Fuerte : No module named rospkg
Hi all,
I recently migrated to Fuerte and upon building a ros package that used to build in Electric, it throws the following error in Fuerte:
[rosbuild] Building package mapping.sa
[rosbuild] Error from syntax check of mapping.sa/manifest.xml
Traceback (most recent call last):
File "", line 1, in
File "/opt/ros/fuerte/lib/python2.7/dist-packages/roslib/__init__.py", line 50, in
from roslib.launcher import load_manifest
File "/opt/ros/fuerte/lib/python2.7/dist-packages/roslib/launcher.py", line 42, in
import rospkg
ImportError: No module named rospkg
CMake Error at /opt/ros/fuerte/share/ros/core/rosbuild/private.cmake:78 (message):
[rosbuild] Syntax check of mapping.sa/manifest.xml failed; aborting
Call Stack (most recent call first):
/opt/ros/fuerte/share/ros/core/rosbuild/public.cmake:174 (_rosbuild_check_manifest)
subarchitectures/mapping.sa/CMakeLists.txt:56 (rosbuild_init)
So the main problem is that rospkg is not found. This seems similar to these questions:
1. [Import Error](http://answers.ros.org/question/39657/importerror-no-module-named-rospkg/)
2. [Import Error 2](http://answers.ros.org/question/44356/importerror-no-module-named-rospkg/)
The solution there is to install rospkg. I already have it installed.
shanker@lt-pool-213:~$ sudo apt-get install python-rospkg
[sudo] password for shanker:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-rospkg is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
I check my PYTHONPATH and it shows:
shanker@lt-pool-213:~$ echo $PYTHONPATH
/opt/ros/fuerte/share/ros/core/roslib/src:/opt/ros/fuerte/lib/python2.7/dist-packages:/opt/ros/fuerte/lib/python2.7/dist-packages:
1. The path '/opt/ros/fuerte/share/ros/core/roslib/src' doesn't even exist. roslib exists at : '/opt/ros/fuerte/share/roslib'. But there isn't an src folder there. So I'm not sure if that is the problem.
2. Alternatively, the problem is probably at /opt/ros/fuerte/lib/python2.7/dist-packages . That directory does not have the file rospkg. It has files roslib, rospy, rosnode, rosmsg etc., but not rospkg. Could that be the problem?
Update: Sep 28, 2012: According to Lorenz's suggestion, I have found that rospkg is in /usr/lib/pymodules/python2.7 . However, the problem persists.
Update: Sep 28, 2012: Upon adding '/usr/lib/pymodules/python2.7' to the pythonpath, the error does resolve. However, I am not removing this question as this is still unexpected behavior.
Thanks in advance for your help :)
Cheers
Shanker
↧
actionlib ImportError for python
Hi folks, ROS noob here. For some reason I get an ImportError for actionlib with the following:
#!/usr/bin/env python
import cv
import roslib; roslib.load_manifest('robot_red')
import rospy
import actionlib
#rest of code...
which results in "ImportError: No module named actionlib" in the terminal. If anyone can describe what the problem might be I'll be eternally grateful. Thanks!
↧
Import file for executing cmd_vel
Sorry I am new to ROS. I have an external program that generates an ASCII text file (say 'walk.dat') which consists of two columns of values of linear velocity and angular velocity, say 1000 rows of (a,b). Would like to write a ROS package that can read in the data and execute rostopic pub cmd_vel geometry_msgs/Twist '[a,0,0]' '[0,0,b]' according to the values in the file. I also want to do it by Turtlebot simulator in Gazebo. I really appreciate if someone can teach me step by step from the very beginning (e.g. open a terminal) to the very end (e.g. rosrun something). Thank you very much indeed.
↧
↧
How to import sr_robot_msgs in Python
I tried to run this code but doesn't work.
#!/usr/bin/env python
import roslib; roslib.load_manifest('rospy_tutorials')
import rospy
from std_msgs.msg import *
from stacks.shadow_robot.sr_robot_msgs.msg import JointControllerState
def callback(data):
rospy.loginfo(rospy.get_caller_id()+"I heard %s", data)
def listener():
rospy.init_node('listener', anonymous=True)
rospy.Subscriber("sh_ffj3_mixed_position_velocity_controller/command", JointControllerState, callback)
# spin() simply keeps python from exiting until this node is stopped
rospy.spin()
if __name__ == '__main__':
listener()
the answer for this is:
Traceback (most recent call last):
File "/home/paulo/ros_workspace/sandbox/beginner_tutorials/scripts/listener.py", line 7, in
from stacks.shadow_robot.sr_robot_msgs.msg import JointControllerState
ImportError: No module named stacks.shadow_robot.sr_robot_msgs.msg
How to import sr_robot_msgs?
↧
Problem importing scenes/objects into environment
Hello everyone,
I installed moveit from the repo and am running it with ROS Hydro on Ubuntu 13.04 (although I've also tried on 12.04). Things seem to work fine with the pr2 tutorial. I followed the same steps to configure a schunk 7 DOF manipulator and then roslaunch demo.launch from that config.
Everything seems ok except that I cannot import anything into the environment. When the select file dialog box appears, it isn't able to navigate through folders. It's strange because I can do it (although slowly) with the pr2 demo.launch.
Any ideas why this is happening?
Thank you
↧
cannot include custom .msg files in python code
I have created my own msg files and would now like to use them in python. One line trips me up over and over.
from my_package.msg import *
I get an error like this:
> ImportError: No module named> my_package
I do believe I have written the '.msg' files correctly, and I have executed 'catkin_make' successfully on the workspace I'm using for ros development. I also believe I've edited the CMakeLists.txt file correctly.
cmake_minimum_required(VERSION 2.8.3)
project(my_package)
find_package(catkin REQUIRED COMPONENTS
geometry_msgs
roscpp
rospy
std_msgs
message_generation
map_store
)
add_message_files(
FILES
MapListEntryList.msg
MapListElement.msg
# Message2.msg
)
generate_messages(
DEPENDENCIES
#my_package
# MapListEntryList
# geometry_msgs# std_msgs
)
catkin_package(
# INCLUDE_DIRS include
LIBRARIES my_package map_store
CATKIN_DEPENDS message_runtime geometry_msgs roscpp rospy std_msgs
# DEPENDS system_lib
)
include_directories(
${catkin_INCLUDE_DIRS}
)
install(PROGRAMS
scripts/turtlebot_listen.py
scripts/turtlebot_map.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
The two .msg files are trivial:
# MapListEntryList.msg
# num of available maps/ num of maps in list
int8 len
# list of available map_id objects
my_package/MapListElement[] list
and
# MapListElement.msg
string name
string id
I can use rosmsg to look at both messages. If anyone can point out what I'm doing wrong, I'd be grateful.
↧
Importing python packages into node files
I have set up my ROS package with the following layout:
packagename
CMakeLists.txt
package.xml
|- src/
|- packagename/
|- __init__.py
|- package_file.py
|- scripts/
|- node_file.py
And in `node_file.py`, I'd like to be able to do
from packagename import package_file
But I get `cannot import name package file`.
Am I laying this out correctly? How do I make my python package visible to `node_file.py`? I am using ROS Hydro in Ubuntu 12.04 LTS.
↧
↧
Importerror : cannot import name
Hello,
I have been working on a node using a normal python IDE (spyder). Everything works fine, I can import all the needed python modules, some installed in /usr/local/lib and other in /usr/lib .
When I run my code with rosrun,
from withings import WithingsAuth, WithingsApi
ImportError: cannot import name WithingsAuth
withings is a module that was installed under
Does somebody know how to fix this?
↧
Importing ROS Messages in Python
I'm using ROS as middleware to connect my model (in Python) and my view (in JS), so I want to keep my Python code as separate as possible from ROS-related code. My directory structure looks like:
.
|____CMakeLists.txt
|____cops_and_robots
| |______init__.py
| |____Cop.py
| |____Map.py
| |____MapObj.py
| |____Robot.py
| |____test
| | |____unit
| | | |______init__.py
| | | |____moveTest.py
|____msg
| |____battery.msg
| |____cmd.msg
|____package.xml
|____README.txt
|____scripts
| |____status_talker.py
| |____websocket_interface.py
|____setup.py
I'm trying to import `battery.msg` from my `status_talker.py` script, but Python doesn't work too well with relative imports.
I have two questions:
1. Do I need to add an `__init__.py` to my `msg` folder to be able to import `battery.msg`? I don't entirely know pythonic standards, but it seems odd that I'd need to designate `msg` as a module.
2. Is this an acceptable way to structure my package? I'm trying to be standards-compliant, but I don't know if I am!
↧
Android pubsub Listener custom message
Hello,
can anybody tell me how to import a custom message into a java Listener for my Android Project?
I modified the Listeners and Talkers in rosjava_core tutorial_pubsub and did ./gradlew install to build a jar out of my files.
I managed to use custom messages in RosTextViews nad know how to build .java or .jar from my custom messages.
How does the Listerner has to look like? Where do i have to put the .java or .jar and how can i import them to this Listener.java?
Thanks
package org.ros.rosjava_tutorial_pubsub;
import org.apache.commons.logging.Log;
import org.ros.message.MessageListener;
import org.ros.namespace.GraphName;
import org.ros.node.AbstractNodeMain;
import org.ros.node.ConnectedNode;
import org.ros.node.NodeMain;
import org.ros.node.topic.Subscriber;
import mypackage.mymessage; ???????
public class Listener_mycustom_message extends AbstractNodeMain {
public int intVar_a=0;
public int intVar_b=0;
@Override
public GraphName getDefaultNodeName() {
return GraphName.of("APP/listener_mycustom_message");
}
@Override
public void onStart(ConnectedNode connectedNode) {
final Log log = connectedNode.getLog();
Subscriber subscriber = connectedNode.newSubscriber("mytopic", my_package.my_message._TYPE);
subscriber.addMessageListener(new MessageListener() {
@Override
public void onNewMessage(my_package.my_message message) {
intVar_a = message.getVar_a();
intVar_b = message.getVar_b();
}
});
}
}
default Listener
package org.ros.rosjava_tutorial_pubsub;
import org.apache.commons.logging.Log;
import org.ros.message.MessageListener;
import org.ros.namespace.GraphName;
import org.ros.node.AbstractNodeMain;
import org.ros.node.ConnectedNode;
import org.ros.node.NodeMain;
import org.ros.node.topic.Subscriber;
public class Listener extends AbstractNodeMain {
@Override
public GraphName getDefaultNodeName() {
return GraphName.of("rosjava_tutorial_pubsub/listener");
}
@Override
public void onStart(ConnectedNode connectedNode) {
final Log log = connectedNode.getLog();
Subscriber subscriber = connectedNode.newSubscriber("chatter", std_msgs.String._TYPE);
subscriber.addMessageListener(new MessageListener() {
@Override
public void onNewMessage(std_msgs.String message) {
log.info("I heard: \"" + message.getData() + "\"");
}
});
}
}
↧
error in import
Dear ROS-Users
I created a service in my_package but I am not able to import it. In particular, using "from my_package import srv" in a ros-python node raise me this error: ImportError: cannot import name srv
However, doing the same "from my_package import srv" from a python shell, I don't get any error
I'm using catkin on ros-hydro and both catkin_make and catkin_make install don't give me any erro
Thank you for your help
↧
↧
Error in Importing Custom Message Types in a Python File in Eclipse
I have created a msgs package containing a msg folder which contains the custom messages in .msg format. When I try to import the .msg files in eclipse from my module in python, eclipse gives an error that " No Module Named msgs.msg".
The exact code I use is -
from msgs.msg import FloatStamped, FloatArrayStamped, waypoint_navigation_status
The folder structure is like this
surveying - package name
src
module.py (This is where I try to import the msg files)
msgs - package name
msg - folder containing .msg files
FloatStamped.msg, FloatArrayStamped.msg, waypoint_navigation_status.msg
Can anybody please help??
Thanks
↧
Error on importing some meshes to gazebo
Well guys, i'm using a 3D modeled Hexapod robot that was make on Solid Workd. Well, I'm trying to import that robot to the gazebo simulator. I worked with other simulator, the Morse, then I needed to export my robot to Blender and save in blender format. I saw that gazebo uses a .dae and .stl files to atach like meshes, but i was trying tu use blender to create that meshes and it was not effective. I was receiving some error with the file created when tried to test. So, could you tell me one easy way to open that robot on Gazebo, or some usefull tutorials? I followed all tutorials using mesh from gazebo, but when i tried to do it myself, got some errors.
↧
Unable to Run Tutorial Client (Python)
Hi,
I'm very new to ROS and I'm working through the tutorial for "Writing a Simple Service and Client (Python)." I've been through all the previous tutorials, but now I've encountered an error:
> Traceback (most recent call last): > File> "/home/ntbeyers/indigo_workspace/sandbox/beginner_tutorials/scripts/add_two_ints_client.py",> line 5, in > from beginner_tutorials.srv import * ImportError: No module named beginner_tutorials.srv
This occurs when I try the command "rosrun beginner_tutorials add_two_ints_client.py" but for some reason it doesn't the server runs without this error. Both python scripts include the same line "from beginner_tutorials.srv import *"
I've made sure the necessary changes have been made to the CMakeLists.txt file. Any ideas why the server would be able to import the "beginner_tutorials.srv" file but the client can't?
I'm using rosbuild if that makes a difference.
Thanks,
Nate
↧