Robotics StackExchange | Archived questions

Gazebo sim code concepts

Dear all,

I was looking into the conveyor demo and specifically why it didn't work. As it turns out it is due to a patch not having been merged until dart6.13.

Anyway, before I realized that I had been looking extensively at the source code, and there's a certain mechanism I'd like to understand better:

Given a dart version < 6.13, DART_HAS_CONTACT_SURFACE is not set, so this featurelist does not contain SetContactPropertiesCallbackFeature, and consequentially neither the DartsimFeatures.

This results in this EntityCast returning nullptr.

Can anyone clarify this a bit?

It seems that:

I didn't dig into that further, as it is rather hard to read (for me at least :-) and it answers the how is the cast done question, but not where is the relation between the world entity and the DartsimFeatures defined?

I think this might be it, but I don't see how the worldPtrPhys is linked to the DartsimFeatures.

Can anyone clarify this?

Thanks

Asked by jrtg on 2023-03-28 03:31:49 UTC

Comments

Answers

EntityFeatureMap is a helper class to check if a physics entity has required and optional features. The list of optional features can be found at https://github.com/gazebosim/gz-sim/blob/3592c201094b94b36a3edbd1f03f89d959f4e578/src/systems/physics/Physics.cc#L450-L623.

For the World gz-physics entity, for example, the gz-sim Physics system has

  public: using WorldEntityMap = EntityFeatureMap3d<
          physics::World,
          MinimumFeatureList,
          CollisionFeatureList,
          ContactFeatureList,
          SetContactPropertiesCallbackFeatureList,
          NestedModelFeatureList,
          CollisionDetectorFeatureList,
          SolverFeatureList>;

Which says, the World entity, has the required features listed in MinimumFeatureList, and the rest are optional features.

Asked by azeey on 2023-03-28 14:09:02 UTC

Comments

Thanks, I'll have a deeper look based on that info.

Asked by jrtg on 2023-03-30 05:40:12 UTC

More or less by coincidence, I found this community meeting recording in which an overview is given of the concepts of gz-physics.

Asked by jrtg on 2023-08-02 05:13:28 UTC

Comments