gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
663 stars 260 forks source link

/world/<name_world>/pose/info made random numbers #1509

Closed Kakcalu13 closed 2 years ago

Kakcalu13 commented 2 years ago

Environment

Description

* Actual behavior:   n

name: "freenove_smart_car" id: 25 position { x: -1.4130059618855037e-10 y: 3.4495946332577985e-12 z: -0.0448807174173829 }

Generated x and y randomly. See here video:
![ezgif-1-a9122a15c2](https://user-images.githubusercontent.com/65916520/170718514-7882d1ad-8d34-4ffb-b63b-d26f838afce7.gif)

## Steps to reproduce
<!-- Provide steps so we can try to reproduce this issue -->

1. `ign topic -e -t /world/free_world/pose/info | grep "freenove_smart_car" -A6` in a separate terminal
2. Load world in a separate terminal
3. Load robot using the command: ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean --timeout 300 --req 'sdf_filename: ''"models/sdf/freenove_smart_car.sdf" pose: {position: {z: 5}} ' in a separate terminal
4. Seeing X and Y generated random numbers from the first terminal

I made a zip for you to reproduce it easier:
[delete_this.zip](https://github.com/gazebosim/gz-sim/files/8787335/delete_this.zip)

If you are seeing this, ignore it since there is no png pictures in this folder. It is expected errors and doesn't impact on actual project.
![image](https://user-images.githubusercontent.com/65916520/170719391-b03caa2c-650c-4682-b9ee-4840d31e9649.png)

But I've found alternate way to "fix" this by add x and y greater than 0.0 which is here:

ign service -s /world/free_world/create --reqtype ignition.msgs.EntityFactory --reptype ignition.msgs.Boolean --timeout 300 --req 'sdf_filename: ''"models/sdf/freenove_smart_car.sdf" pose: {position: {x: 0.1, y: 0.1, z: 5}} '



This fixed the issue, but why can't it do that if it's 0 or no input on coordinate? 
Kakcalu13 commented 2 years ago

Fortress does the same thing too image

bwuk@robots:~/feagi/test$ ign gazebo --version
Ignition Gazebo, version 6.9.0
Copyright (C) 2018 Open Source Robotics Foundation.
Released under the Apache 2.0 License.

bwuk@robots:~/feagi/test$ 
luca-della-vedova commented 2 years ago

I'm not sure I see where the issue is, generally speaking some deviation is expected because of floating point errors, or approximations in the physics solver. From what I can see the values between iterations change by a value that is much less than 10^-9 for x and y (below one nanometer!) while the model seems to be slowly moving up in Z (maybe you spawned it a bit too far below ground and now it's slowly moving up to avoid having the mesh intersecting with the ground plane?).

Kakcalu13 commented 2 years ago

I think you are right as this is expected.

I assumed that just no input of coordination caused it acting up but once you add the input, it shows exact same as it should be.

Maybe this is not worth to mention the issue. Just add x,y,z in the command to avoid the "acting up" numbers.

Thank you so much!