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

Add SpawnEntity, DeleteEntity, & SetEntityPose Support #380

Draft
wants to merge 6 commits into
base: ros2
Choose a base branch
from

Conversation

retinfai
Copy link

@retinfai retinfai commented Apr 7, 2023

🎉 New feature

Closes #363

Summary

Add support for SpawnEntity, DeleteEntity, & SetEntityPose services
Add support for EntityFactory

Test it

Spin up a parameter bridge for the service you are testing, and make a ros2 service call to it

Example for SpawnEntity

gz sim empty.sdf
ros2 run ros_gz_bridge parameter_bridge /world/empty/create@ros_gz_interfaces/srv/SpawnEntity
ros2 service call /world/empty/create ros_gz_interfaces/srv/SpawnEntity "{entity_factory: {name: "cool_sdf", sdf_filename: 'path/to/sdf'}}"

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.

@retinfai retinfai requested a review from ahcorde as a code owner April 7, 2023 21:46
@osrf-triage osrf-triage added this to Inbox in Core development Apr 7, 2023
@retinfai retinfai closed this Apr 10, 2023
Core development automation moved this from Inbox to Done Apr 10, 2023
@azeey
Copy link
Contributor

azeey commented Apr 10, 2023

@retinfai Did you mean to close this PR?

@retinfai
Copy link
Author

I wasn't sure whether I had to have all the things checked off before opening the PR? Or can it be open, while I complete all the tasks

@azeey
Copy link
Contributor

azeey commented Apr 10, 2023

You can mark it as a draft PR if you're still working on it. Reviewers might give you initial feedback.

@retinfai retinfai reopened this Apr 10, 2023
@retinfai retinfai marked this pull request as draft April 10, 2023 19:03
@retinfai
Copy link
Author

Perfect, thanks

@jpvr20
Copy link

jpvr20 commented Jan 1, 2024

Is there any updates on this?

@azeey
Copy link
Contributor

azeey commented Jan 2, 2024

Is there any updates on this?

Not that I know if. It would be great to get this PR moving again.

@retinfai
Copy link
Author

retinfai commented Jan 2, 2024

Is there any updates on this?

Functionally everything in this PR works. I've been using it in my projects fine. Just haven't had time to go back and follow the process properly. Will try to move things along

@jpvr20
Copy link

jpvr20 commented Jan 2, 2024

@retinfai
I tried using the SetEntityPose service, but I'm not getting any response. any ideas? Using Gazebo Garden and Ros2 humble

ros2 run ros_gz_bridge parameter_bridge /world/bluerov2_heavy_underwater/set_pose@ros_gz_interfaces/srv/SetEntityPose

ros2 service call /world/bluerov2_heavy_underwater/set_pose ros_gz_interfaces/srv/SetEntityPose "{entity: {id: 8, name: "rgbd_camera2", type: 6}, pose: {position: {x: 0.2, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}"

It prints this, but no response after this,

requester: making request: ros_gz_interfaces.srv.SetEntityPose_Request(entity=ros_gz_interfaces.msg.Entity(id=8, name='rgbd_camera2', type=6), pose=geometry_msgs.msg.Pose(position=geometry_msgs.msg.Point(x=0.2, y=0.0, z=0.0), orientation=geometry_msgs.msg.Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)))

@retinfai
Copy link
Author

retinfai commented Jan 3, 2024

It prints this, but no response after this,
I guess it doesn't all work haha. Haven't tried the services on sensors, there could be a gap

@retinfai I tried using the SetEntityPose service, but I'm not getting any response. any ideas? Using Gazebo Garden and Ros2 humble

ros2 run ros_gz_bridge parameter_bridge /world/bluerov2_heavy_underwater/set_pose@ros_gz_interfaces/srv/SetEntityPose

ros2 service call /world/bluerov2_heavy_underwater/set_pose ros_gz_interfaces/srv/SetEntityPose "{entity: {id: 8, name: "rgbd_camera2", type: 6}, pose: {position: {x: 0.2, y: 0.0, z: 0.0}, orientation: {x: 0.0, y: 0.0, z: 0.0, w: 1.0}}}"

It prints this, but no response after this,

requester: making request: ros_gz_interfaces.srv.SetEntityPose_Request(entity=ros_gz_interfaces.msg.Entity(id=8, name='rgbd_camera2', type=6), pose=geometry_msgs.msg.Pose(position=geometry_msgs.msg.Point(x=0.2, y=0.0, z=0.0), orientation=geometry_msgs.msg.Quaternion(x=0.0, y=0.0, z=0.0, w=1.0)))

Hmm, not quite sure. Everything looks fine; haven't tried services on things other than a model, so i guess it isn't all working haha. Can you verify that you get the correct expected behaviour calling the service from the gazebo side? gz service ....

@jpvr20
Copy link

jpvr20 commented Jan 3, 2024

@retinfai There was some problem in my package. The model is moving fine using the service.

Edit
The sensors doesn't work and the behavior is not same using gazebo service. It changes values of world pose cmd instead of pose. gazebo service doesn't do anything. Not sure if I'm using it right

retinfai and others added 2 commits January 5, 2024 18:50
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Afereti Pama <79831813+retinfai@users.noreply.github.com>
Co-authored-by: Alejandro Hernández Cordero <ahcorde@gmail.com>
Signed-off-by: Afereti Pama <79831813+retinfai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

SpawnEntity, DeleteEntity, SetPose Services
5 participants