Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for simulation interfaces #1

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

adamdbrw
Copy link

Following ros-infrastructure/rep#410, this PR contains a first version of simulation interfaces.

Signed-off-by: Adam Dąbrowski <[email protected]>
@adamdbrw adamdbrw changed the title First (complete) draft of simulation interfaces Proposal for simulation interfaces Dec 17, 2024
Copy link

@peci1 peci1 left a comment

Choose a reason for hiding this comment

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

As stated in the comments, I think EntityState should not be a part of Entity. Instead, a message EntityWithState could be created to bind the two.

msg/Entity.msg Outdated Show resolved Hide resolved
msg/Entity.msg Outdated Show resolved Hide resolved
msg/EntityState.msg Outdated Show resolved Hide resolved
msg/SpawnPose.msg Outdated Show resolved Hide resolved
msg/SpawnPose.msg Outdated Show resolved Hide resolved
srv/SetSimulationPaused.srv Show resolved Hide resolved
srv/SetSimulationPaused.srv Outdated Show resolved Hide resolved
srv/SpawnEntity.srv Outdated Show resolved Hide resolved
srv/DeleteEntity.srv Outdated Show resolved Hide resolved
srv/SpawnEntity.srv Outdated Show resolved Hide resolved
msg/Entity.msg Outdated Show resolved Hide resolved
msg/EntityState.msg Outdated Show resolved Hide resolved
adamdbrw and others added 6 commits December 19, 2024 15:32
Co-authored-by: Martin Pecka <[email protected]>
Co-authored-by: Steve Peters <[email protected]>
Signed-off-by: Adam Dąbrowski <[email protected]>
Signed-off-by: Adam Dąbrowski <[email protected]>
Signed-off-by: Adam Dąbrowski <[email protected]>
Signed-off-by: Adam Dąbrowski <[email protected]>

robot_namespace -> namespace

Signed-off-by: Adam Dąbrowski <[email protected]>
Signed-off-by: Adam Dąbrowski <[email protected]>
Copy link
Collaborator

@azeey azeey left a comment

Choose a reason for hiding this comment

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

I left a couple comments. Unfortunately, I haven't had much time to review this PR, so there are still parts I haven't reached. I'll be on vacation for a couple weeks, but I'll try to make this a priority when I return.

msg/EntityState.msg Outdated Show resolved Hide resolved
msg/SpawnableBounds.msg Outdated Show resolved Hide resolved
@adamdbrw adamdbrw requested review from scpeters, peci1 and azeey January 7, 2025 14:13
@adamdbrw
Copy link
Author

adamdbrw commented Jan 7, 2025

All comments so far have been addressed, please take another look and approve / suggest changes.

Copy link

@DLu DLu left a comment

Choose a reason for hiding this comment

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

Thank you for putting in this work.

For progress sake, you may want to consider breaking this up into several PRs. If you made one with just the package metadata, then merge that immediately, and then the other bits can go in chunks.

I'd also like to integrate another interface for collisions but that is blocked at the moment.

msg/EntityState.msg Outdated Show resolved Hide resolved
action/MultiStepSimulation.action Outdated Show resolved Hide resolved
action/MultiStepSimulation.action Outdated Show resolved Hide resolved
action/MultiStepSimulation.action Show resolved Hide resolved
msg/SpawnPose.msg Outdated Show resolved Hide resolved
srv/GetEntityState.srv Outdated Show resolved Hide resolved
srv/GetSimulatorFeatures.srv Show resolved Hide resolved
srv/GetSimulatorFeatures.srv Outdated Show resolved Hide resolved
srv/GetSimulatorFeatures.srv Outdated Show resolved Hide resolved
srv/StepSimulation.srv Outdated Show resolved Hide resolved
adamdbrw and others added 3 commits January 13, 2025 13:39
Co-authored-by: David V. Lu!! <[email protected]>
- wording change for stepping service
- features message
- comment documentation for USD and URDF formats
- custom formats list field

Signed-off-by: Adam Dąbrowski <[email protected]>
@adamdbrw
Copy link
Author

@DLu thank you for the review, I applied most of your comments and responded to remaining 2 with some argumentation.
I am open to break the PR down if needed, and to include collisions at a later stage (once this one is merged)

msg/SimulatorFeatures.msg Outdated Show resolved Hide resolved
msg/SpawnPose.msg Outdated Show resolved Hide resolved
Copy link
Collaborator

@azeey azeey left a comment

Choose a reason for hiding this comment

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

Sorry for the long delay in responding. I like the scope of the PR and the direction it's been evolving so far.

I'd like to ask if @omichel would also chime in for the Webots perspective.

msg/EntityWithState.msg Show resolved Hide resolved

std_msgs/Header header # Frame and timestamp for pose and twist. Empty frame defaults to world.
geometry_msgs/Pose pose # Pose in reference frame, ground truth.
geometry_msgs/Twist twist # Ground truth body twist in the reference frame.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think for ground truth twist, the body twist has to be expressed in the world frame. In the convention mentioned in ros2/common_interfaces#240, we'd have:

body_frame_id = "frame_name_of_entity" 
header.frame_id = "world"
reference_frame_id = "world"

@tfoote can you confirm? When both header.frame_id and reference_frame_id are "world", it looks like a spatial twist, but that's not what we need here. Maybe we need to clarify that the VelocityStamped message always represents body twists, but expressed in the frame specified by reference_frame_id.

Copy link
Author

Choose a reason for hiding this comment

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

@azeey @tfoote once you confirm, I would welcome a suggestion or an extra context to make sure I understand and apply this correctly

action/MultiStepSimulation.action Outdated Show resolved Hide resolved
msg/SpawnPose.msg Outdated Show resolved Hide resolved
msg/SpawnPose.msg Outdated Show resolved Hide resolved
srv/SpawnEntity.srv Outdated Show resolved Hide resolved
srv/SpawnEntity.srv Outdated Show resolved Hide resolved
srv/SpawnEntity.srv Outdated Show resolved Hide resolved
srv/StepSimulation.srv Outdated Show resolved Hide resolved
msg/SpawnPose.msg Outdated Show resolved Hide resolved
Copy link

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

@DLu asked me to take a look at this due to my work on https://github.com/sea-bass/pyrobosim -- as such, you now have even more feedback in this very ambitious (and unenviable) task of standardizing such a thing.

Hope this is helpful!

README.md Outdated Show resolved Hide resolved
msg/EntityState.msg Outdated Show resolved Hide resolved
msg/SimulatorFeatures.msg Outdated Show resolved Hide resolved
msg/SimulatorFeatures.msg Outdated Show resolved Hide resolved
msg/Spawnable.msg Outdated Show resolved Hide resolved
srv/GetSimulatorFeatures.srv Outdated Show resolved Hide resolved
srv/GetSpawnPoses.srv Outdated Show resolved Hide resolved
srv/GetSpawnables.srv Show resolved Hide resolved
srv/ResetSimulation.srv Show resolved Hide resolved
srv/SpawnEntity.srv Show resolved Hide resolved
adamdbrw and others added 2 commits January 20, 2025 10:48
Co-authored-by: David V. Lu!! <[email protected]>
Co-authored-by: Addisu Z. Taddese <[email protected]>
- Changed SpawnPose to NamedPose, added tags.
- SpawnEntity interface substantially updated.
- Some improved documentation, especially regarding spawning.
- applied other code review comments

Signed-off-by: Adam Dąbrowski <[email protected]>
srv/SpawnEntity.srv Outdated Show resolved Hide resolved
# Robot or other object which can be spawned in simulation runtime.

string uri # URI which will be accepted by SpawnEntity service.
string description # Optional description for the user, e.g. "robot X with sensors A,B,C".
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, this field makes more sense as an input for the GetSpawnables service. I'd imagine a simulator can have multiple sources of spawnables:

  1. Local disk (other ROS packages, files placed in directories where the simulator expects, etc.)
  2. Remote (Files from a remote service, such as Fuel)

Both of these sources may have subcategorizations to limit the number spawnables returned as well the depth of searching required.

We could make the field an array of strings and let the simulator define what the values are, or we can make them enums if there is broad agreement on what the enums should be. I lean toward an array of strings.

srv/SpawnEntity.srv Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants