0
$\begingroup$

Gazebo Answers logo

Hi, everyone. My problem is that whenever i try to insert my car into the terrain (made from heigtmap), it suddently jump off the terrain to very high and then fall down outside the terrain.

I tried a lot but could not figure out the cause. Could you help me? Thanks.

My terrain world: click here

My car model: click here


Originally posted by TyNguyen on Gazebo Answers with karma: 13 on 2014-05-07

Post score: 0


Original comments

Comment by TyNguyen on 2014-05-08:
Thanks to the suggestion of #nkoenig, i solved the problem. Here is the simple thing that i did: In sdf model, set the pose of the model so that its initial z > the height of a point on terrain surface (on which i put/insert my car) Then, i just need to run simulation and insert my car onto the the terrain.

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

The problem could be that the car starts in the middle of the terrain. Gazebo will then correct for this by pushing the car up.

Could you try the following:

  1. Pause the simulator.
  2. Insert your car.
  3. Move your car so that it starts a bit above the heightmap.
  4. unpause the simulator.

Originally posted by nkoenig with karma: 7676 on 2014-05-07

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by TyNguyen on 2014-05-07:
Thanks. I tried to follow your instruction but it does not work. When i pause the simulator and insert the car, the car does not appear (maybe, it is underneath the terrain's surface). Then, because i could not move it as you said, it jump off the ground again after i resume the simulator. Does the setting poses in car sdf matter? However, things such as utility_cart can be inserted normally (of course, they also jump off the ground but not much, so that, they can stay till on the ground).

Comment by nkoenig on 2014-05-09:
If you can't see the inserted model, you can still select it using the model-list widget on the left. You can also make the terrain transparent by right-clicking on the terrain. Setting the pose in SDF does matter.

Comment by TyNguyen on 2014-05-14:
Thanks, nkoenig. I got it done after changing pose in car sdf ( just let z > the height of the terrain, for my case, it is 10m.)

Comment by TyNguyen on 2014-05-14:
Btw i'm concerning how to build a slope road with a given steep angle. What i'm doing now: use Matlab to create a matrix with row element's value proportional to its height(same in a collumn). Then, i normalize the whole elements in matrix = dividing them by the max value of all elements so that they are all in between 0 and 1 => Printing out this matrix to .png file => terrain file. =>Insert this terrain file into heightmap.world. Is there any other method? & grey value of 1=? m in height?

$\endgroup$

Your Answer

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