Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to change min_depth parameter in model plugin

I'm trying to set different than default max_depth parameter for wheels of the robot. I managed to change the sdf code of the contact tag and when i use the Load function, the values do change in the gazebo GUI, but the robot does not behave as if anything changed. When I position the wheels 1 cm below the ground , the wheels are pushed above the ground regardless.

sdf::ElementPtr surface_sdf = this->link_ptr->GetCollision(_index)->GetSDF()->GetElement("surface");
sdf::ElementPtr min_depth_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("min_depth");
sdf::ElementPtr max_vel_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("max_vel");
min_depth_sdf->Set(0.02);
max_vel_sdf->Set(0.0);
this->link_ptr->GetCollision(_index)->GetSurface()->Load(surface_sdf);

How to change min_depth parameter in model plugin

I'm trying to set different than default max_depth parameter for wheels of the robot. I managed to change the sdf code of the contact tag and when i use the Load function, the values do change in the gazebo GUI, but the robot does not behave as if anything changed. When I position the wheels 1 cm below the ground , the wheels are pushed above the ground regardless.

sdf::ElementPtr surface_sdf = this->link_ptr->GetCollision(_index)->GetSDF()->GetElement("surface");
sdf::ElementPtr min_depth_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("min_depth");
sdf::ElementPtr max_vel_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("max_vel");
min_depth_sdf->Set(0.02);
max_vel_sdf->Set(0.0);
this->link_ptr->GetCollision(_index)->GetSurface()->Load(surface_sdf);

image description

How to change min_depth parameter in model plugin

I'm trying to set different than default max_depth parameter for wheels of the robot. I managed to change the sdf code of the contact tag and when i use the Load function, the values do change in the gazebo GUI, but the robot does not behave as if anything min_depth changed. When I position the wheels 1 cm below the ground , the wheels are pushed above the ground regardless.regardless. The 'max_vel' parameter does get uploaded correctly and the robot does not jump after being pushed out of the ground, however.

sdf::ElementPtr surface_sdf = this->link_ptr->GetCollision(_index)->GetSDF()->GetElement("surface");
sdf::ElementPtr min_depth_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("min_depth");
sdf::ElementPtr max_vel_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("max_vel");
min_depth_sdf->Set(0.02);
max_vel_sdf->Set(0.0);
this->link_ptr->GetCollision(_index)->GetSurface()->Load(surface_sdf);

image description

How to change min_depth parameter in model plugin

I'm trying to set different than default max_depth parameter for wheels of the robot. I managed to change the sdf code of the contact tag and when i use the Load function, the values do change in the gazebo GUI, but the robot does not behave as if min_depth changed. When I position the wheels 1 cm below the ground , the wheels are pushed above the ground regardless. The 'max_vel' parameter does get uploaded correctly and the robot does not jump after being pushed out of the ground, however.

sdf::ElementPtr surface_sdf = this->link_ptr->GetCollision(_index)->GetSDF()->GetElement("surface");
sdf::ElementPtr min_depth_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("min_depth");
sdf::ElementPtr max_vel_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("max_vel");
min_depth_sdf->Set(0.02);
max_vel_sdf->Set(0.0);
this->link_ptr->GetCollision(_index)->GetSurface()->Load(surface_sdf);

image description

How to change min_depth parameter in model pluginplugin?

I'm trying to set different than default max_depth parameter for wheels of the robot. I managed to change the sdf code of the contact tag and when i use the Load function, the values do change in the gazebo GUI, but the robot does not behave as if min_depth changed. When I position the wheels 1 cm below the ground , the wheels are pushed above the ground regardless. The 'max_vel' parameter does get uploaded correctly and the robot does not jump after being pushed out of the ground, however.

sdf::ElementPtr surface_sdf = this->link_ptr->GetCollision(_index)->GetSDF()->GetElement("surface");
sdf::ElementPtr min_depth_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("min_depth");
sdf::ElementPtr max_vel_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("max_vel");
min_depth_sdf->Set(0.02);
max_vel_sdf->Set(0.0);
this->link_ptr->GetCollision(_index)->GetSurface()->Load(surface_sdf);

image description

How to change min_depth parameter in model plugin?

I'm trying to set different than default max_depth parameter for wheels of the robot. I managed to change the sdf code of the contact tag and when i use the Load function, the values do change in the gazebo GUI, but the robot does not behave as if min_depth changed. When I position the wheels 1 cm below the ground , the wheels are pushed above the ground regardless. The 'max_vel' parameter does get uploaded correctly and the robot does not jump after being pushed out of the ground, however.

sdf::ElementPtr surface_sdf = this->link_ptr->GetCollision(_index)->GetSDF()->GetElement("surface");
sdf::ElementPtr min_depth_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("min_depth");
sdf::ElementPtr max_vel_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("max_vel");
min_depth_sdf->Set(0.02);
max_vel_sdf->Set(0.0);
this->link_ptr->GetCollision(_index)->GetSurface()->Load(surface_sdf);

image description


EDIT 1

From my experiments I also came to conclusion, that the 'max_vel' parameter can be set from plugin only in case the QuickStep stepping method is being used. When running the simulation with the WorldStep stepping method, setting the 'max_vel' parameter from the plugin also does not have any effect.

Can anybody provide any explanation to this issue?

How to change min_depth parameter in model plugin?

I'm trying to set different than default max_depth parameter for wheels of the robot. I managed to change the sdf code of the contact tag and when i use the Load function, the values do change in the gazebo GUI, but the robot does not behave as if min_depth changed. When I position the wheels 1 cm below the ground , the wheels are pushed above the ground regardless. The 'max_vel' parameter does get uploaded correctly and the robot does not jump after being pushed out of the ground, however.

sdf::ElementPtr surface_sdf = this->link_ptr->GetCollision(_index)->GetSDF()->GetElement("surface");
sdf::ElementPtr min_depth_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("min_depth");
sdf::ElementPtr max_vel_sdf = surface_sdf->GetElement("contact")->GetElement("ode")->AddElement("max_vel");
min_depth_sdf->Set(0.02);
max_vel_sdf->Set(0.0);
this->link_ptr->GetCollision(_index)->GetSurface()->Load(surface_sdf);

image description


EDIT 1

From my experiments I also came to conclusion, that the 'max_vel' max_vel parameter can be set from plugin only in case the QuickStep stepping method is being used. When running the simulation with the WorldStep stepping method, setting the 'max_vel' parameter from the plugin also does not have any effect.

Can anybody provide any explanation to this issue?