I am simulating a truck in Gazebo, which operates well in a minimal empty world, responding effectively to cmd_vel commands sent via the bcr_teleop package. However, when the simulation is run in more complex environments, such as the default Sonoma Raceway or custom off-road terrains, the truck hardly moves.

The truck model, defined in a .xacro file, includes four active wheels (first and fourth) responsible for traction and four passive wheels (second and third) that are intended to be pulled without providing additional traction. Despite adjusting various parameters, the truck's mobility remains significantly restricted in these complex environments.

Here are the key adjustments I've made in an attempt to improve performance:

PID Tuning for Active Wheels:

  • Increased the P gain in the steering PID from 1500 to 1700 for better steering response.
  • Increased the P gain in the linear velocity PID from 1000 to 1200 for better velocity control.

Friction and Collision Settings for Active Wheels:

-Increased the friction coefficients (mu and mu2) from 1.0 to 1.5 to enhance traction.

-Increased the spring stiffness constant (kp) from 5000000.0 to 7000000.0 for better surface contact.

  • Increased the damping coefficient (kd) from 1.0 to 3.0 for improved shock absorption.

Despite these adjustments, the truck's movement in complex environments like Sonoma Raceway or off-road terrains is minimal compared to its performance in an empty world. This leads me to suspect that the issue might involve interaction with the environment's surface properties or other Gazebo-specific physics settings affecting vehicle-ground interactions.


Truck Only moves on Empty world, not over terrains

Given the truck's design, with passive wheels on the second and third shafts, I'm curious if the terrain's properties in these complex environments are contributing to the limited mobility. Is there a particular Gazebo setting or simulation parameter that I might be overlooking that could account for this discrepancy in performance across different environments?

Any insights, suggestions, or diagnostic tips would be greatly appreciated, as I aim to achieve realistic truck movement across various terrains in Gazebo.


1 Answer 1


The solution was switch the default complex physics:

    <physics type="ode">
      <max_step_size>0.013</max_step_size> <!-- Smaller for more accuracy -->
          <iters>100</iters> <!-- Reduced from 150 to potentially soften the simulation, lower to reduce computational load -->
          <sor>1.4</sor> <!-- Lower to potentially reduce rigidity -->
          <cfm>0.001</cfm> <!-- Lower for a tighter simulation, reducing "sponginess" -->
          <erp>0.15</erp> <!-- Increase to ensure error correction is more effective -->
          <contact_max_correcting_vel>500.000000</contact_max_correcting_vel> <!-- Lower to reduce the aggressiveness of contact corrections -->
          <contact_surface_layer>0.01</contact_surface_layer> <!-- Lower to minimize penetration without increasing rigidity -->

for this basic one, based on Prius Repository

    <physics name='default_physics' default='0' type='ode'>

However I am still facing an issue, which is the joints of my truck does not let it static, even if I publish a cmd_vel = 0 to emulate a handbrake. It starts falling down on reverse as the video below shows:

Truck Sliding on Reverse

I am trying to implement a fake anchor, kind of handbrake, to attach the truck to the ground, but not sure if it is going to work.

Otherwise I will need to switch the simple ackermman gazeboplugin for a more complex dynamic truck model, which assigns torque, force, power, etc to the truck's whell joints such as Prius Hybrid Plugins


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.