Skip to content

Conversation

@IceShuttle
Copy link
Contributor

@IceShuttle IceShuttle commented Nov 14, 2025

🦟 Bug fix

Summary

This pull requests solves the issue in gz-physics but since it requires changes in this repo instead of gz-physics I am opening this pr here.
With this gazebo now supports changing gravity at runtime by running
'gz service -s /world/world_demo/set_physics --reqtype gz.msgs.Physics --reptype gz.msgs.Boolean --timeout 2000 --req 'gravity { x: 0 y: 0 z: -2.8 }'

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

Signed-off-by: Shivang [email protected]

Copy link
Contributor

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also get an integration test to ensure this does not accidentally get deleted or broken?

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Nov 14, 2025
@arjo129
Copy link
Contributor

arjo129 commented Nov 14, 2025

Can you also fix the DCO signature following these instructions: https://github.com/gazebosim/gz-sim/pull/3189/checks?check_run_id=55365258481

@IceShuttle IceShuttle force-pushed the gravity-cmd-fix branch 2 times, most recently from e3544ff to 08f1544 Compare November 14, 2025 13:18
@IceShuttle
Copy link
Contributor Author

Can we also get an integration test to ensure this does not accidentally get deleted or broken?

Hi I have tried to add the test but I don't know if this works properly since I have a weak laptop it gives me an oom error.
So I have to rely on the automated workflow or anyone else to run it untill I can my hands on something more powerful
Sorry for the inconvenience

@IceShuttle IceShuttle changed the base branch from gz-sim10 to main November 14, 2025 13:24
@IceShuttle IceShuttle changed the base branch from main to gz-sim10 November 14, 2025 13:25
@IceShuttle IceShuttle changed the base branch from gz-sim10 to main November 14, 2025 13:53
@arjo129
Copy link
Contributor

arjo129 commented Nov 14, 2025

One way I avoid OOM errors while building gazebo is to use export MAKEFLAGS=-j1 and build using colcon build --executor sequential. You also probably only want to run the test that you affected. So rather than colcon test you can find the binaries of the individual tests inside the build directory created by colcon.

@IceShuttle
Copy link
Contributor Author

One way I avoid OOM errors while building gazebo is to use export MAKEFLAGS=-j1 and build using colcon build --executor sequential. You also probably only want to run the test that you affected. So rather than colcon test you can find the binaries of the individual tests inside the build directory created by colcon.

It actually builds just fine and I tried running only the individual tests by running ctest --rerun-failed --output-on-failure command

@IceShuttle
Copy link
Contributor Author

Thanks for you suggestion of manually running the binary that helped me find out that the out of memory error was actually not out of memory it was because of my code accidentally tried to double free a pointer. (I don't know why it said oom? maybe it just classifies memory errors as oom??) wierd!!
Anyways now its working correctly

@arjo129
Copy link
Contributor

arjo129 commented Nov 15, 2025

LGTM once you get passed the style related issues flagged by the CI. I tested it and it works well.
You can use pre-commit if you want to automatically format your code.
Thanks for your contribution.

@arjo129
Copy link
Contributor

arjo129 commented Nov 15, 2025

Couple more minor style issues:
Screenshot 2025-11-15 at 1 03 33 PM

@IceShuttle IceShuttle requested a review from arjo129 November 15, 2025 12:02
@IceShuttle
Copy link
Contributor Author

Ran pre-commit hopefully this time it should work

Signed-off-by: Arjo Chakravarty <[email protected]>
Copy link
Contributor

@arjo129 arjo129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed a minor style fix. LGTM! Thanks for your work on this.

@arjo129 arjo129 merged commit d2780bb into gazebosim:main Nov 16, 2025
14 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Core development Nov 16, 2025
@IceShuttle IceShuttle deleted the gravity-cmd-fix branch November 16, 2025 01:17
@arjo129
Copy link
Contributor

arjo129 commented Nov 16, 2025

@Mergifyio backport gz-sim10 gz-sim9 gz-sim8 ign-gazebo6

@mergify
Copy link
Contributor

mergify bot commented Nov 16, 2025

backport gz-sim10 gz-sim9 gz-sim8 ign-gazebo6

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 16, 2025
This pull requests solves the [issue](gazebosim/gz-physics#766) in gz-physics but since it requires changes in this repo instead of gz-physics I am opening this pr here.
With this gazebo now supports changing gravity at runtime by running
'gz service -s /world/world_demo/set_physics   --reqtype gz.msgs.Physics   --reptype gz.msgs.Boolean   --timeout 2000   --req 'gravity { x: 0 y: 0 z: -2.8 }'
---------

Signed-off-by: Shivang <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
(cherry picked from commit d2780bb)
mergify bot pushed a commit that referenced this pull request Nov 16, 2025
This pull requests solves the [issue](gazebosim/gz-physics#766) in gz-physics but since it requires changes in this repo instead of gz-physics I am opening this pr here.
With this gazebo now supports changing gravity at runtime by running
'gz service -s /world/world_demo/set_physics   --reqtype gz.msgs.Physics   --reptype gz.msgs.Boolean   --timeout 2000   --req 'gravity { x: 0 y: 0 z: -2.8 }'
---------

Signed-off-by: Shivang <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
(cherry picked from commit d2780bb)
mergify bot pushed a commit that referenced this pull request Nov 16, 2025
This pull requests solves the [issue](gazebosim/gz-physics#766) in gz-physics but since it requires changes in this repo instead of gz-physics I am opening this pr here.
With this gazebo now supports changing gravity at runtime by running
'gz service -s /world/world_demo/set_physics   --reqtype gz.msgs.Physics   --reptype gz.msgs.Boolean   --timeout 2000   --req 'gravity { x: 0 y: 0 z: -2.8 }'
---------

Signed-off-by: Shivang <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
(cherry picked from commit d2780bb)
mergify bot pushed a commit that referenced this pull request Nov 16, 2025
This pull requests solves the [issue](gazebosim/gz-physics#766) in gz-physics but since it requires changes in this repo instead of gz-physics I am opening this pr here.
With this gazebo now supports changing gravity at runtime by running
'gz service -s /world/world_demo/set_physics   --reqtype gz.msgs.Physics   --reptype gz.msgs.Boolean   --timeout 2000   --req 'gravity { x: 0 y: 0 z: -2.8 }'
---------

Signed-off-by: Shivang <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
(cherry picked from commit d2780bb)

# Conflicts:
#	src/SimulationRunner.cc
#	src/systems/physics/Physics.cc
#	test/integration/user_commands.cc
arjo129 added a commit that referenced this pull request Nov 17, 2025
This pull requests solves the [issue](gazebosim/gz-physics#766) in gz-physics but since it requires changes in this repo instead of gz-physics I am opening this pr here.
With this gazebo now supports changing gravity at runtime by running
'gz service -s /world/world_demo/set_physics   --reqtype gz.msgs.Physics   --reptype gz.msgs.Boolean   --timeout 2000   --req 'gravity { x: 0 y: 0 z: -2.8 }'
---------




(cherry picked from commit d2780bb)

Signed-off-by: Shivang <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Shivang <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
arjo129 added a commit that referenced this pull request Nov 26, 2025
This pull requests solves the [issue](gazebosim/gz-physics#766) in gz-physics but since it requires changes in this repo instead of gz-physics I am opening this pr here.
With this gazebo now supports changing gravity at runtime by running
'gz service -s /world/world_demo/set_physics   --reqtype gz.msgs.Physics   --reptype gz.msgs.Boolean   --timeout 2000   --req 'gravity { x: 0 y: 0 z: -2.8 }'
---------




(cherry picked from commit d2780bb)

Signed-off-by: Shivang <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Shivang <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
@azeey azeey moved this from Done to Highlights in Core development Dec 4, 2025
arjo129 added a commit that referenced this pull request Dec 8, 2025
This pull requests solves the [issue](gazebosim/gz-physics#766) in gz-physics but since it requires changes in this repo instead of gz-physics I am opening this pr here.
With this gazebo now supports changing gravity at runtime by running
'gz service -s /world/world_demo/set_physics   --reqtype gz.msgs.Physics   --reptype gz.msgs.Boolean   --timeout 2000   --req 'gravity { x: 0 y: 0 z: -2.8 }'
---------




(cherry picked from commit d2780bb)

Signed-off-by: Shivang <[email protected]>
Signed-off-by: Arjo Chakravarty <[email protected]>
Co-authored-by: Shivang <[email protected]>
Co-authored-by: Arjo Chakravarty <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪵 jetty Gazebo Jetty

Projects

Status: Highlights

Development

Successfully merging this pull request may close these issues.

3 participants