Gazebo | Ignition | Community
Ask Your Question

Trmotta's profile - activity

2016-11-01 14:11:56 -0500 received badge  Nice Question (source)
2015-05-28 10:54:56 -0500 received badge  Famous Question (source)
2015-01-23 18:44:01 -0500 received badge  Notable Question (source)
2015-01-21 06:50:34 -0500 received badge  Popular Question (source)
2015-01-19 07:07:35 -0500 commented answer Joint created in runtime is not working properly

Thank you once again, Andrei. Ill be hoping for it to be fixed by the end of the month with the new release of Gazebo 5.0.

2015-01-19 06:50:00 -0500 received badge  Famous Question (source)
2015-01-16 10:30:14 -0500 commented answer How to add a link/joint in runtime

Should I delete this comment?

2015-01-16 10:27:46 -0500 commented answer How to add a link/joint in runtime
2015-01-16 10:27:09 -0500 asked a question Joint created in runtime is not working properly

Hello everyone!

I recently had a problem where I needed to edit a robot in runtime, adding new joints and links to it. After asking this question in this thread the way to go was to create a new Model and attach both models, which is working. However, whenever a link is attached to a different model, I end up loosing the last link in that model, so it was needed to recreate it everytime an attachment was made. The problem here is that this is giving me some overhead, so in order to get a better performance I tried the previous thread suggestion like this:

std::string modelNameStr( parentModelName );

gazebo::physics::ModelPtr model = GetModelPtr(modelNameStr);
gazebo::physics::LinkPtr model1Link = model->GetLink("Rope_Segment_2");

LOGGER.Write(Log::INFO,"Model jointCount : %d \n", model->GetJointCount() );

gazebo::physics::ModelPtr model2 = GetModelPtr("Bola");
gazebo::physics::LinkPtr model2Link = model2->GetLink("Link0");

newJoint = world->GetPhysicsEngine()->CreateJoint( "revolute", model );
newJoint->SetName("Joint3");
newJoint->SetModel( model );

newJoint->Load(model1Link, model2Link, model2Link->GetWorldPose() );
newJoint->Attach(model1Link, model2Link);

newJoint->SetAxis(0,  gazebo::math::Vector3(0.0f,1.0f,0.0f) );
newJoint->SetLowerLimit( 0, gazebo::math::Angle( 0.0f ) );
newJoint->SetUpperLimit( 0, gazebo::math::Angle( 0.2f ) );

LOGGER.Write(Log::INFO,"Model jointCount : %d \n", model->GetJointCount() );

if( model->GetJoint("Joint3") == NULL )
    LOGGER.Write(Log::INFO,"Model GetJoint : FALSE \n" );
else
    LOGGER.Write(Log::INFO,"Model GetJoint : OK \n" );

And the result is that both Logger.Write gives me the same number and the last If also returns FALSE. In the other hand, if I keep the reference to this newly created Joint Im still able to access it and make it work like a normal joint would. So for me it seems that this new Joint is created somewhere but its just not being added to the joint list or something like it.

Anyone know what am I doing wrong?

Thanks!

2015-01-16 08:27:02 -0500 answered a question How to add a link/joint in runtime

The attach is working great when I already have two different models! However, whenever a link is attached to a different model, I end up loosing the last link in that model, so it was needed to recreate it everytime an attachment was made. The problem here is that this is giving me some overhead, so in order to get a better performance I tried your suggestion like this:

std::string modelNameStr( parentModelName );

gazebo::physics::ModelPtr model = GetModelPtr(modelNameStr);
gazebo::physics::LinkPtr model1Link = model->GetLink("Rope_Segment_2");

LOGGER.Write(Log::INFO,"Model jointCount : %d \n", model->GetJointCount() );

gazebo::physics::ModelPtr model2 = GetModelPtr("Bola");
gazebo::physics::LinkPtr model2Link = model2->GetLink("Link0");

newJoint = world->GetPhysicsEngine()->CreateJoint( "revolute", model );
newJoint->SetName("Joint3");
newJoint->SetModel( model );

newJoint->Load(model1Link, model2Link, model2Link->GetWorldPose() );
newJoint->Attach(model1Link, model2Link);

newJoint->SetAxis(0,  gazebo::math::Vector3(0.0f,1.0f,0.0f) );
newJoint->SetLowerLimit( 0, gazebo::math::Angle( 0.0f ) );
newJoint->SetUpperLimit( 0, gazebo::math::Angle( 0.2f ) );

LOGGER.Write(Log::INFO,"Model jointCount : %d \n", model->GetJointCount() );

if( model->GetJoint("Joint3") == NULL )
    LOGGER.Write(Log::INFO,"Model GetJoint : FALSE \n" );
else
    LOGGER.Write(Log::INFO,"Model GetJoint : OK \n" );

And the result is that both Logger.Write gives me the same number and the last If also returns FALSE. In the other hand, if I keep the reference to this newly created Joint Im still able to access it and make it works like a normal joint would. So for me it seems that this new Joint is created in the right way but its just not being added to the joint list or something like it.

Anyone know what am I doing wrong?

Thanks!

P.S: Should I start a new thread with this question?

2015-01-16 08:21:46 -0500 received badge  Commentator
2015-01-13 12:36:20 -0500 commented answer How to add a link/joint in runtime

Thanks! That solved it!

2015-01-13 12:36:00 -0500 received badge  Supporter (source)
2015-01-13 12:35:57 -0500 received badge  Scholar (source)
2015-01-12 09:01:59 -0500 received badge  Notable Question (source)
2015-01-09 11:10:59 -0500 received badge  Popular Question (source)
2015-01-08 16:07:56 -0500 received badge  Good Question (source)
2015-01-08 15:31:21 -0500 received badge  Nice Question (source)
2015-01-08 15:06:08 -0500 received badge  Student (source)
2015-01-08 14:41:27 -0500 asked a question How to add a link/joint in runtime

Hello!

Id like to know if its possible to edit a robot in runtime by adding new Links/Joints to it while still having the simulation running and affecting the whole model (unlike the method editor). Ive stumbled upon this UpdateParameters method, but Im not quite sure this will do what I want, although updating an SRDF seems promising.

Im currently using Gazebo 4 on Ubuntu Precise.

If this is possible, does anyone know how to accomplish it ?

Thank you!

2014-07-07 12:18:54 -0500 received badge  Famous Question (source)
2014-04-07 07:59:10 -0500 received badge  Notable Question (source)
2014-02-24 11:47:18 -0500 received badge  Popular Question (source)
2014-02-21 05:36:17 -0500 received badge  Taxonomist
2014-02-03 11:29:18 -0500 received badge  Famous Question (source)
2014-01-29 11:58:17 -0500 asked a question Cant run rrbot examle at gazebo

So im following this tutorial: http://gazebosim.org/wiki/Tutorials/1.9/UsingAURDFInGazebo Using latest gazebo 1.9.x version, with Ubuntu 12.04.2 LTS (Precise Pangolin) and ROS Hydro.

Everything is going fine till I have to see the RRbot at gazebo.

This is the error: Service call failed: transport error completing service call: unable to receive data from sender, check sender's logs for details Segmentation fault (core dumped) [gazebo-2] process has died [pid 10783, exit code 139, cmd /opt/ros/hydro/lib/gazeboros/gzserver /home/adminubuntu/catkinws/src/gazeborosdemos/rrbotgazebo/worlds/rrbot.world _name:=gazebo __log:=/home/adminubuntu/.ros/log/6a3573f2-890e-11e3-9daa-20cf300f3a96/gazebo-2.log]. log file: /home/adminubuntu/.ros/log/6a3573f2-890e-11e3-9daa-20cf300f3a96/gazebo-2*.log

This is the complete log file folder: https://www.dropbox.com/s/an178dkvc759ew5/6a3573f2-890e-11e3-9daa-20cf300f3a96.zip

What does that mean? What am I missing? Thank you!

2014-01-29 10:50:01 -0500 commented question Gazebo 1.9 + ROS Hydro + Moveit-PR2 = Cant control Gazebo with Moveit

Great! This is what I have atm: export GAZEBO_PLUGIN_PATH=/usr/lib/gazebo-1.9/plugins Updated it to this: export GAZEBO_PLUGIN_PATH=/usr/lib/gazebo-1.9/plugins:/opt/ros/hydro/lib:/opt/ros/hydro/include:/opt/ros/hydro/share:/opt/ros/hydro/lib/python2.7/dist-packages Should I add anything else?

2014-01-29 02:07:18 -0500 received badge  Notable Question (source)
2014-01-28 10:52:59 -0500 received badge  Popular Question (source)
2014-01-28 10:52:30 -0500 commented question Gazebo 1.9 + ROS Hydro + Moveit-PR2 = Cant control Gazebo with Moveit

This is the setup.bash file in /opt/ros/hydro (and the only one found):

#!/usr/bin/env bash

generated from catkin/cmake/templates/setup.bash.in

CATKIN_SHELL=bash

source setup.sh from same directory as this file

CATKINSETUP_DIR=$(builtin cd "dirname "${BASH_SOURCE[0]}"" && pwd)

. "$CATKINSETUP_DIR/setup.sh"