gz-sim
gz-sim copied to clipboard
Allow SDF model to be constructed in a single shot
🎉 New feature
Summary
This PR tweaks the behavior of the physics system so that when constructing a model it will first check if a ModelSdf
component is available for the entity. If so, it uses that component to fill in all the model information, overriding the fields that are given by the other entity components (e.g. name and pose).
When creating a link, the physics engine will first check if a link of the same name for that model was already constructed. If so, the construction step is skipped, the link is queried from the model, and it gets added to the entity map. Same for joints and collision objects.
The net result of these behavioral changes is that physics engines which can only construct models all at once are able to be used for the typical use cases, while physics engines that can construct models incrementally can still do so when the user wants them to.
Test it
Try running with the dartsim plugin. Even though the behavior changed, there is no noticeable difference in the outcome.
The ability to test these changes with a bullet-featherstone
plugin is forthcoming. The implementation is finished, but I am debugging some segfaults from inside of bullet at the moment.
Checklist
- [ ] Signed all commits for DCO
- [ ] Added tests
- [ ] Added example and/or tutorial
- [ ] 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
Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by
messages.
Joint is not placed in the right pose (bullet-featherstone
), tested with log_record_dbl_pendulum.sdf
The seg fault issue with the classic bullet plugin is fixed by gazebosim/gz-physics#393 and the TPE failing to load is fixed by 4b01010.
I think the joint offset issue for bullet-featherstone
shouldn't be a blocker for this PR since that will need to be fixed in gazebosim/gz-physics#373 and wouldn't involve any changes to this PR.
@osrf-jenkins retest this please
@mxgrey we have a whole slew of test failures here that aren't in main
. I spent a little bit of time, but didn't make much headway.
Removed the Garden
label because we're past feature freeze ❄️ .
This PR can either be merged into main
and backported to gz-sim7
after the stable release, or retargeted to gz-sim7
and merged after the stable release (i.e. October).
@osrf-jenkins retest this please
@osrf-jenkins retest this please
ackermann_steering | ok |
acoustic_comms_demo | vehicles are not moving properly |
acoustic_comms_moving_targets.sdf | wierd |
acoustic_comms.sdf | ok |
actor_crowd | ok |
linear_battery_demo.sdf | ok |
logical_audio_sensor_plugin.sdf | ok |
logical_camera_sensor.sdf | ok |
log_record_dbl_pendulum.sdf | ok |
log_record_keyboard.sdf | ok |
actor_crowd.sdf | ok |
log_record_resources.sdf | ok |
actor.sdf | ok |
log_record_shapes.sdf | ok |
actors_population.sdf | ok |
mecanum_drive.sdf | not working |
minimal_scene.sdf | ok |
apply_joint_force.sdf | vel can be setted but when zero is setted the joint will not stop (damping is not applied) |
model_photo_shoot.sdf | segfault |
apply_link_wrench.sdf | ok |
multicopter_velocity_control.sdf | small quad can takeoff but the hexacopter cannot |
auv_controls.sdf | doing the wrong thing |
multi_lrauv_race.sdf | the vehicle in the middle is not working properly the other two sometimes are doing wierd stuff too |
boundingbox_camera.sdf | ok |
nested_model.sdf | ok |
breadcrumbs.sdf | box is getting some initial speed and the vehicle is not include in the physics engine |
optical_tactile_sensor_plugin.sdf | ok |
buoyancy_engine.sdf | boxes are moving up and down, not sure if this is ok |
particle_emitter.sdf | ok |
buoyancy.sdf | motor is rotating but the model is stuck in the same position |
pendulum_links.sdf | removing the velocity plugin works well, commands are doing wierd things |
camera_sensor.sdf | ok |
perfect_comms.sdf | ok |
camera_video_record_dbl_pendulum.sdf | ok |
performer_detector.sdf | ok |
physics_options.sdf | ok |
collada_world_exporter.sdf | ok |
plane_propeller_demo.sdf | plane doing wierd things, crazy since the beginning of the simulation |
contact_sensor.sdf | ok |
plot_3d.sdf | ok |
conveyor.sdf | feature not implemented |
polylines.sdf | polyline not supported as a collision shape |
debug_shapes.sdf | ok |
pose_publisher.sdf | ok |
default.sdf | ok |
quadcopter.sdf | ok |
dem_monterey_bay.sdf | not supported |
rf_comms.sdf | ok |
dem_moon.sdf | not supported |
rolling_shapes.sdf | ok |
dem_volcano.sdf | not supported |
segmentation_camera.sdf | ok |
deprecated_ignition.sdf | ok |
sensors_demo.sdf | ok |
depth_camera_sensor.sdf | ok |
sensors.sdf | ok |
detachable_joint.sdf | ok |
shader_param.sdf | segfautl |
diff_drive.sdf | ok |
shapes_bitmask.sdf | not implemented |
diff_drive_skid.sdf | ok |
elevator.sdf | ok (need to adjust PID) |
shapes.sdf | ok |
empty_gui.sdf | ok |
skid_steer_mecanum.sdf | not turning properly |
empty.sdf | ok |
sky.sdf | ok |
follow_actor.sdf | ok |
spaces.sdf | ok |
fuel.sdf | ok (heightmap not supported) |
spherical_coordinates.sdf | when spawn a model, the model is crazy |
fuel_textured_mesh.sdf | ok |
thermal_camera.sdf | error reading world, might be related with the migration, this world should work |
gpu_lidar_retro_values_sensor.sdf | ok |
gpu_lidar_sensor.sdf | ok |
touch_plugin.sdf | ok |
graded_buoyancy.sdf | some physics errors |
track_drive.sdf | models are crazy |
grid.sdf | ok |
tracked_vehicle_simple.sdf | segfault |
heightmap.sdf | not supported |
trajectory_follower.sdf | working but not doing the same as dartsim |
import_mesh.sdf | ok |
triggered_camera_sensor.sdf | ok |
joint_controller.sdf | ok |
triggered_publisher.sdf | ok |
joint_position_controller.sdf | ok |
trisphere_cycle_wheel_slip.sdf | ok |
joint_trajectory_controller.sdf | ok |
tunnel.sdf | segfault |
kinetic_energy_monitor.sdf | not working (missing features?) |
velocity_control.sdf | ok |
levels_no_performers.sdf | |
video_record_dbl_pendulum.sdf | ok |
levels.sdf | ok |
visibility.sdf | ok |
lift_drag_battery.sdf | joint rotating but not taking off |
visualize_contacts.sdf | ok |
lift_drag_nested.sdf | issues building model |
visualize_lidar.sdf | ok (car jumps at the beginning) |
lift_drag.sdf | joint rotates but the model is not taking off |
wide_angle_camera.sdf | ok |
lightmap.sdf | not able to see anything in the minimal scene (rendering issue?) |
wind.sdf | ok |
lights.sdf | ok |
world_joint.sdf | segfault |
NOTES:
- There are some tutorials to record logs but it will be great to add some instructions to the sdf files
@osrf-jenkins retest this please
@mxgrey @ahcorde What needs to be done to merge this one?
@osrf-jenkins retest this please
@mxgrey @ahcorde What needs to be done to merge this one?
I believe that I got all the tests passing, but CI isn't reflecting that yet, giving it another go.
@osrf-jenkins retest this please
Codecov Report
Merging #1560 (d411d1b) into gz-sim7 (6a8594b) will increase coverage by
0.09%
. The diff coverage is69.80%
.
:exclamation: Current head d411d1b differs from pull request most recent head 8e6c8e2. Consider uploading reports for the commit 8e6c8e2 to get more accurate results
@@ Coverage Diff @@
## gz-sim7 #1560 +/- ##
===========================================
+ Coverage 64.16% 64.25% +0.09%
===========================================
Files 335 336 +1
Lines 26508 26889 +381
===========================================
+ Hits 17008 17277 +269
- Misses 9500 9612 +112
Impacted Files | Coverage Δ | |
---|---|---|
include/gz/sim/SystemLoader.hh | 100.00% <ø> (ø) |
|
include/gz/sim/detail/EntityComponentManager.hh | 93.86% <ø> (ø) |
|
include/gz/sim/rendering/RenderUtil.hh | 100.00% <ø> (ø) |
|
.../plugins/component_inspector/ComponentInspector.hh | 28.57% <ø> (ø) |
|
src/gui/plugins/scene_manager/GzSceneManager.cc | 17.58% <0.00%> (-0.60%) |
:arrow_down: |
...rc/systems/ackermann_steering/AckermannSteering.hh | 100.00% <ø> (ø) |
|
src/systems/track_controller/TrackController.cc | 46.80% <ø> (+0.19%) |
:arrow_up: |
.../systems/triggered_publisher/TriggeredPublisher.hh | 100.00% <ø> (ø) |
|
.../plugins/component_inspector/ComponentInspector.cc | 5.46% <2.77%> (-0.33%) |
:arrow_down: |
...s/multicopter_motor_model/MulticopterMotorModel.cc | 75.91% <33.33%> (-0.22%) |
:arrow_down: |
... and 19 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.