Faster than Real -Time support in GZ#23783
Conversation
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
|
@Jaeyoung-Lim @dagar can you please give this a review? seems like a good addition |
There was a problem hiding this comment.
Amazing thanks!
-
Just one small nitpick on the order of configuring the physics.
-
More of a question/note: Since we configure the physics in the gz bridge, this might cause problems when running multiple px4 instances. Might be worth taking it out to somewhere else in the future.
Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
|
This will good and will need docs hint hint |
|
@Jaeyoung-Lim is there anything preventing this from going in? I've addressed the comments so far. I think @hamishwillee is right that we will need a docs update after it goes in |
|
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: |
|
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: |
|
@dirksavage88 As I commented above, you are configuring the physics only when a model exists. However, physics is more of a world parameter and therefore should not be related to the model itself, but rather the world. For example, this would break if there are multiple vehicles in the simulation with the gz_bridge Therefore I think it would be better if the config is done outside of gz_bridge. |
|
@Jaeyoung-Lim I'm going push back and say this is a nitpick. What is the functional benefit to placing the physics outside of the gz_bridge? If you have no model and just a world, what is the functional benefit to having physics with nothing for physics to act on? Also the world services are created in gz_bridge here: Should not the physics also be configured along with the world services? |
|
@dirksavage88 Yes, and that needs to change if we want to support multiple vehicles. |
|
@Jaeyoung-Lim okay that is making sense now. So there should be somewhere else in the code where we can do both world services and physics. |
|
@dirksavage88 Probably rethinking this - lets get this in as is, since I dont want to slow you down due to architectural improvements. But lets put a note somewhere that we need to fix this, so that it flows nicely to multi vehicle support. |
|
Also please create an issue to track this, make sure to assign yourself. |
So this only breaks if each px4-sitl instance has a different value for PX4_SIM_SPEED_FACTOR. Which is probably pretty easy to screw up. I don't think there's a way to set this directly in the world SDF though. I agree we should get it in now and fix later. |
|
@dirksavage88 @Jaeyoung-Lim Re docs, is this as simple as updating https://docs.px4.io/main/en/simulation/#run-simulation-faster-than-realtime to mention Gazebo (GZ) supports this too? Are there any specific things to think about that are different on GZ? |
I think the COM_DL_LOSS_T param still applies, however I do notice that in the new gz with a speed up factor of 10x, I am not able to get local/global position to work. I am not sure if this was also the case for gz classic. I can get the x500 to arm in SITL with a speed up of 5x though |
@dirksavage88 the issue is that this PR increases the time step rather than the real_time_factor. I have an open PR which is a large refactor of the the GZBridge and px4-rc.simulator which fixes this. If you want to try it out and leave a review! |
|
Thanks very much. Needs review: PX4/PX4-user_guide#3628 |
* add rtf service to gzbridge Signed-off-by: dirksavage88 <dirksavage88@gmail.com> * physics before model spawn Signed-off-by: dirksavage88 <dirksavage88@gmail.com> --------- Signed-off-by: dirksavage88 <dirksavage88@gmail.com>
Solved Problem
The new GZ simulation real time factor is configurable, however the service request has not been implemented in the GZ bridge.
partially fixes Fixes #23602
Solution
Changelog Entry
For release notes:
Alternatives
Change the real time facto in gazebo world sdf manually, or make a world file specific to an increased RTF
Test coverage
rtf.webm
Context
Related links, screenshot before/after, video