Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all 7017 articles
Browse latest View live

Convert terminal command to messages/plugin

$
0
0
Hi there,

I'm trying to control a differential drive robot to follow a ball. I thought I could initialize a node with the ball and publish it's pose and initialize another node on the robot(pioneer2dx) to subscribe to it. After implementing this, further for controlling the robot, I don't know how to apply velocity to each wheel separately. From the terminal I could send instructions and control left and right wheel separately with the command **gz joint -m pioneer2dx -j right_wheel_hinge --vel-t 2**. How can I implement this by using messages or using plugins?

Thanks in advance

Gazebo 4 - Ros Fuerte interaction ??

$
0
0
Hi! I'm doing a Gazebo based simulator, I have some restrictions (I have to use Ros Fuerte), so I'm using Ubuntu 12 and Gazebo 4 (I saw here http://gazebosim.org/ that it was the last compatible with Ubuntu Precise). I'm not able to generate any Ros topics from my cameras or other sensors, only see them using the gz topics: gzserver room.world --verbose gz topic -v /gazebo/default/camlens_left/left_camera/image (I need to pass this to a ROS topic). My question is, is there any way to interact between Ros Fuerte and Gazebo 4 or do I have to use the first version of Gazebo and rewrite my models and world?

ERROR while loading world with DiffDrivePlugin as model plugin

$
0
0
Hi there,

I'm trying to control a Pioneer2dx with *DiffDrivePlugin*. Whenever I start the server, an error occurs. I got the plugin from [here](https://bitbucket.org/osrf/gazebo/src/b60a5186d0008a915ccdc632f17df5d09ca33c24/plugins/DiffDrivePlugin.cc?at=default&fileviewer=file-view-default). No errors are coming while complilng.
Error:
**Error [Element.cc:671] Missing element description for [left_joint]
gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:648: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = sdf::Element; typename boost::detail::sp_member_access::type = sdf::Element*]: Assertion `px != 0' failed.
Aborted**

What is this error and why this is coming? Can anyone provide me a solution?

Thanks in advance!

Data corruption from camera sensor

$
0
0
Hi All. I could do with advice on how to investigate what looks like intermittent corrupt data being returned from a camera sensor. I'm accessing the camera image from a model plugin, but when I render the resulting images occasionally the scene will be briefly replaced with a mishmash of bright colours. Frequency of occurrence: 1 or 2 times/minute, usually for less than one second each time. Seems to happen less often if the robot is stationary, i.e. it happens more frequently the more the contents of the scene are changing On the visualization screen projected from the robot within the Gazebo UI, there is no such corruption visible I'm accessing the data from within the plugin OnUpdate event, and actually extracting it using: gazebo::sensors::SensorPtr s2 = gazebo::sensors::get_sensor("camera") gazebo::sensors::CameraSensor *cs = dynamic_cast(sp.get()); const int COLOR_COMPONENTS = 3; int _width = cs->GetImageWidth(); int _height = cs->GetImageHeight(); unsigned char buffer[_width*_height*COLOR_COMPONENTS]; std::stringstream ss; ss << cs->GetImageData(); ss >> buffer; Camera SDF: 0.305 0 0.1 0 -0 01.020100.01500120true I'm not all that experienced with Gazebo, so advice appreciated on just where I start looking to fix this.

Trouble setting up GZWeb

$
0
0
Hello all: Installed gazebo2 (limited by ROS deployment), and was attempting to get gzweb up and running. Running into the following when running `./deploy.sh -m` -- Generating done -- Build files have been written to: /home/specter7/gzweb/build Scanning dependencies of target gzcoarse [100%] Building CXX object tools/CMakeFiles/gzcoarse.dir/gzcoarse.cc.o Linking CXX executable gzcoarse [100%] Built target gzcoarse /usr/bin/env: node: No such file or directory /usr/bin/env: node: No such file or directory There are node-gyp build errors, exiting. This binary file exists and has the permissions which permit it to be read.

Get Pose of a model from a plugin

$
0
0
Hi there,

I want to get the current Pose of the model from a plugin. I tried by using [this](http://pastebin.com/Vb0JtY5C) plugin. But it gives an error when compiling
**error: ‘gazebo::physics::ModelState’ is not a base of ‘gazebo::physics::Model’
** Why this error is coming? And how each coordinate is accessed and is assigned to some other variables?

Thanks in advance!

Scene labeling using a depth camera

$
0
0
Is there any way to get a labeling of the scene as seen from a depth camera - a mapping between each pixel of the image and the corresponding object that generated the depth for that pixel as seen from the camera's viewpoint? So, for a scene with a single table in the middle, all the pixels corresponding to the table have to be labelled as "table". I've tried using the function: GetVisualAt(CameraPtr camera, const math::Vector2i &mousePos) from gazebo::rendering::Scene which casts a ray into the scene to find the intersecting object for a pixel but this is too slow for my use case (assuming a 640 x 480 image, this takes of the order of hundreds of seconds). I think that OGRE would compute this when it renders depth maps, but I'm not too sure how or where to look to get access to this. Any suggestions?

ERROR while loading world with a model plugin

$
0
0
Hi there,

I'm trying to control Pioneer2DX by publishing to topic **pioneer2dx/vel_cmd** on **Gazebo 6.1.0**. It is working perfectly but not in the way which I need. The way in which each wheel velocity is found(from *OnVelMsg()*) is not the way which I need. So, I tried to make a new plugin with the same code of **DiffDrivePlugin** with different statements in *OnVelMsg()*. There were no compilation error but when I load the world with the robot, some error is coming.
Here is the error:
**Error [Element.cc:671] Missing element description for [left_joint]
gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:648: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = sdf::Element; typename boost::detail::sp_member_access::type = sdf::Element*]: Assertion `px != 0' failed.
Aborted**
In the world file, I had specified left_ joint and right_ joint in the plugin tag.
Here is the [world file](http://pastebin.com/s8E3e9ty) and [plugin](http://pastebin.com/2Qhj9g1s) file.
Why this error is coming and what will be solution for this?

Thanks in advance!

What happens after gazebo issues in bitbucket is resolved

$
0
0
Hello all, I have some newbie questions: What happens after a Gazebo issue in Bitbucket is resolved? How do i install the updated version on my machine ? Are the resolved issues are corrected only for the most recent Gazebo version or also for the previous ones ? (As I work with ROS, I use the Gazebo 2) Thanks

Pose and orientation of my robot is incorrect in Gazebo

$
0
0
I have exported the URDF from Solidworks using solidworks to URDF plugin. I didn't modify any option in dialogues opened during export. Then i created an URDF package in ROS workspace and spawned the robot model into the world which resulted in inverted pose of the robot as shown in picture. ![image description](/upfiles/14503736611143291.png) Following is my URDF file, where have i gone wrong and how to patch it up.

ERROR while accessing joints

$
0
0
Hi there,

I was trying to load gazebo with a world file. But it gives following error and exits.

**[Err] [Diff.cc:41] Diff plugin missing <left_joint> element
[Err] [Diff.cc:44] Diff plugin missing <right_joint> element
Error [Element.cc:671] Missing element description for [right_joint]
gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:648: typename boost::detail::sp_member_access::type boost::shared_ptr::operator->() const [with T = sdf::Element; typename boost::detail::sp_member_access::type = sdf::Element*]: Assertion `px != 0' failed.
Aborted**

In the world file I've specified left_element and right_element. Why this is happening?
Also, what is meant by **Missing element description for [right_joint]**? I didn't find any description for joints anywhere. Can anyone provide a solution for this?

Files:
1. [World file](http://pastebin.com/nhUyEAKM)
2. [Model.sdf](http://pastebin.com/cJV19UMh)
3. [Model.config](http://pastebin.com/vXRdmXM7)
4. [Plugin](http://pastebin.com/gpQSXAMk)

Thanks in advance!

Skip looking for models online? (GAZEBO_MODEL_DATABASE_URI)

$
0
0
Hi there, is it possible to skip looking for models online? Similar to [this](http://answers.gazebosim.org/question/5291/disabling-connect-to-server-at-launch/), but without downloading the models. Thanks, Andrei

Inaccurate Pendulum Period

$
0
0
Hello, I'm working on a pendulum model and I'm noticing some inaccuracies when running gazebo with the following world files and pendulum model. What I'm noticing is that the pendulum in the simulation has a wrong period (about a second later than expected). I expect the period to be `2.0071` - my pendulum has a length of `1` as seen in the model file - however after plotting the pose of the ball with respect to time I'm seeing that the period is actually `~2.84`. Currently I'm using ODE as the physics engine however Simbody and Bullet are giving the same results. Any ideas what might be causing this? Thanks! Oh and I'm using gazebo-6.5.1 Model: 0 0 1 0 0 000 0 0 0 -0 00.0110.3 0.3 0.3 10.7 0.7 0.7 10.01 0.01 0.01 10 0 0 1100100 0 0 0 -0 00.01110 0 00001e+0601100.21e+1310.0101-0.0100.21e+1310 0.008999 0.00004 0 0 010 0 0 0 -0 00.110.3 0.3 0.3 10.7 0.7 0.7 10.01 0.01 0.01 10 0 0 1100100 0 0 0 -0 00.1110 0 00001e+0601100.21e+1310.0101-0.0100.21e+131worldfixedPointfixedPointball0 0 0 0 0 01 0 0000.0000.000 World: model://sunmodel://pendulum0.000011000000001 EDIT: (12/20/15 22:53 EST) So after reading [this][1] Q&A I got the pendulum to work. I'm guessing physics simulators don't like really small numbers? Has anybody else had issues with this? [1]: http://www.ode.org/ode-latest-userguide.html#sec_12_7_0

GTS library not found error

$
0
0
Hi there, when I try to create polylines, I get following error: GTS library not found. ![image description](/upfiles/14507019311396682.jpg) But gts library is installed (see picture). ![image description](/upfiles/14507019451584461.jpg) Many thanks in advance and best regards.

Gazebo takes up 1 core when physics is paused

$
0
0
I'm trying to use gazebo on a fairly old laptop of mine - a core 2 duo with 2 gb ram. I'm using Lubuntu 14.04 (with ROS indigo + gazebo2) I ran gazebo using gzserver (no GUI) and paused the physics of gazebo and was checking cpu resources on top (a task manager) - No GUI + physics = RAM is less than 500 MB and CPU usage is 100% for both the cores (And cpu temperature rises up to 70s) - No GUI + Paused physics = RAM is less than 500 MB and CPU usage is 100% for 1 core (And cpu temperature for that core rises up to 70s) Finally, I have 3 questions: 1. Why is gazebo taking up 100% cpu when physics is paused ? Is this expected ? 2. How do I throttle the resources gazebo can take ? I don't want the CPU temperature to go higher than ~60s. Is there a method for me tell gazebo to only work 50% of each core at maximum or something ? (Obviously the simulation will be slower, I don't mind that) 3. Is there any generic way for me to figure out which function in a node is taking up most of the processing power ? How do I profile it ?

Building a plugin : missing SDF.hh

$
0
0
Hi everyone, I'm trying to create my first gazebo plugin. As a start, my goal would be to mix the contact and the diffdrive plugins such as when the robots bumps something it changes direction. I've copied the ContactPlugin.cc and ContactPlugin.hh files found on bitbucket -> gazebo -> plugin, renamed all contactplugin to modcontactplugin but when I tried building I get the following error : In file included from ~/models/my_robot/plugins/ModContactPlugin.hh:26:0, from ~/models/my_robot/plugins/ModContactPlugin.cc:19: /usr/include/gazebo-6.5/gazebo/common/Plugin.hh:42:22: fatal error: sdf/sdf.hh: No such file or directory #include I've looked under /usr/include and I have the folders sdformat-2.0 and sdformat-3.7 but no SDF folder. Thanks for the help!

Intermittent segmentation fault possibly by custom WorldPlugin attaching and detaching child

$
0
0
My goal is to teleport a robot to an arbitrary pose in a 0-gravity world, while keeping the robot in a fixed pose after teleportation. I need to do the teleport a bunch of times. I’ve tried many ways to do this, and here is the only way that does the task, but I get intermittent segmentation faults after running the simulation for a while. I am doing the teleport by attaching and detaching a joint between the world link and the base link of the robot. Attaching the robot to world makes the robot fixed. Detaching the joint allows the robot to be moved freely. The teleport is done by a WorldPlugin. It subscribes to a rosservice (among others) that says detach or attach. It then calls `physics::Joint::Attach(world_link, base_link)` or `physics::Joint::Detach()`. The two links are found by `physics::WorldPtr->GetByName()` and dynamically casted to `physics::LinkPtr`. The intermittent seg fault ALWAYS happens after a Detach() has been done and the rosservice has returned successfully. But the seg fault doesn’t happen within my rosservice handler function inside the WorldPlugin. It happens somewhere else in the simulation loop, which leaves me very puzzled and have nowhere to start debugging! I tried many things to fix this, and I’m still stuck with one big question, what is the seg fault caused by? Is it really from calling `Attach()` and `Detach()` too much? It happens after running simulation for more than 5 to 10 minutes, during which I’ve attached and detached many times. Here is a backtrace from gdb: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x290b of process 11318] 0x0000000100600612 in dQMultiply3 () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_ode.2.dylib (gdb) bt #0 0x0000000100600612 in dQMultiply3 () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_ode.2.dylib #1 0x0000000100617541 in getHingeAngle(dxBody*, dxBody*, double*, double*) () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_ode.2.dylib #2 0x000000010061569f in dxJointHinge::getInfo1(dxJoint::Info1*) () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_ode.2.dylib #3 0x00000001005f392a in dxQuickStepper(dxWorldProcessContext*, dxWorld*, dxBody* const*, int, dxJoint* const*, int, double) () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_ode.2.dylib #4 0x000000010060ea36 in dxProcessIslands(dxWorld*, double, void (*)(dxWorldProcessContext*, dxWorld*, dxBody* const*, int, dxJoint* const*, int, double)) () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_ode.2.dylib #5 0x00000001005e8229 in dWorldQuickStep () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_ode.2.dylib #6 0x00000001005202c1 in gazebo::physics::ODEPhysics::UpdatePhysics() () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_physics_ode.2.dylib #7 0x000000010038483d in gazebo::physics::World::Update() () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_physics.2.dylib #8 0x0000000100383864 in gazebo::physics::World::Step() () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_physics.2.dylib #9 0x0000000100382d66 in gazebo::physics::World::RunLoop() () from /usr/local/Cellar/gazebo2/2.2.6/lib/libgazebo_physics.2.dylib #10 0x00000001019ec6c5 in boost::(anonymous namespace)::thread_proxy(void*) () from /usr/local/lib/libboost_thread-mt.dylib #11 0x00007fff98cab268 in _pthread_body () from /usr/lib/system/libsystem_pthread.dylib #12 0x00007fff98cab1e5 in _pthread_start () from /usr/lib/system/libsystem_pthread.dylib #13 0x00007fff98ca941d in thread_start () from /usr/lib/system/libsystem_pthread.dylib #14 0x0000000000000000 in ?? () gdb shows there are 42 threads, and I looked at each one’s backtrace. The one running my WorldPlugin is NOT the problematic backtrace. I suspect it’s because I attach and detach a bunch, and this changed something that only later gets picked up when the simulation loop does an update, and that’s why it’s showing up in another thread? Any help please! Or an alternative proper way to teleport (that I haven't tried)? Thank you!

Xacro, ruby : SDF parametrization

$
0
0
Hi, I'm looking to control some parameters of my model through the ros launch file. I know that this used to be handle with xacro in urdf file and ruby allow some features in SDF but I not sure how to processed so that I can pass on the arguments from the launch file. Also, would it be better to rather use urdf for my model? Thanks Alex

Do I need to uninstall the 2.2.6 Gazebo before installing the one of version 6.0 ?

$
0
0
When I finished installing ROS Indigo, I noticed that it already came with Gazebo(version2.2.6). If I directly install the 6.0 Gazebo, is it possible that the 6.0 version and 2.2.6 version will conflict with each other?

How to use for loop in launch file in gazebo?

$
0
0
How can implement for loop concept in gazebo to spawn multiple robot model? For example: I want to iterate above code n times, variable being robot_num's value. How should I do that?
Viewing all 7017 articles
Browse latest View live