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

SpawnEntity, DeleteEntity, SetPose Services #363

Open
retinfai opened this issue Feb 10, 2023 · 15 comments · May be fixed by #380
Open

SpawnEntity, DeleteEntity, SetPose Services #363

retinfai opened this issue Feb 10, 2023 · 15 comments · May be fixed by #380
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@retinfai
Copy link

Desired behavior

ros_gz_bridge support SpawnEntity, DeleteEntity, and SetPose services, so I can access them through ROS2 client calls.

Alternatives considered

Running gz services through Subprocesses

Implementation suggestion

Is it just ros_gz_bridge/src/service_factories/ros_gz_interfaces.cpp that needs to be changed? Not too sure, but just a thought.

Additional context

Gazebo Garden, ROS2 Humble.
The interfaces for the services, request types, and response types are already supported in ros_gz_interfaces or other

@retinfai retinfai added the enhancement New feature or request label Feb 10, 2023
@azeey
Copy link
Contributor

azeey commented Feb 16, 2023

This would be a nice addition. A PR would be welcome 😉 .

@azeey azeey added the help wanted Extra attention is needed label Feb 16, 2023
@retinfai
Copy link
Author

I can give it a good go. First open source contribution attempt aha

@zp-yang
Copy link

zp-yang commented Mar 1, 2023

How is the progress on implementing these services? I would also like to help if needed.

@retinfai
Copy link
Author

retinfai commented Mar 1, 2023

I've begun work on this fork and hacked a solution for my own purposes here: https://github.com/retinfai/ros_gz

But more tweaking is needed before I want to submit for review.

Would love collaboration – I haven't found a lot of time recently.

@zp-yang
Copy link

zp-yang commented Mar 4, 2023

which ros2 version and gazebo version are you using? I am running humble and garden.

@retinfai
Copy link
Author

retinfai commented Mar 4, 2023

I'm using that too.

ROS2 Humble & Gazebo Garden

@zp-yang
Copy link

zp-yang commented Mar 4, 2023

Cool, what do you think still needs to be done? You seemed to have all of the features working. I am mainly interested in the set_pose service and it works on my side as well.

@retinfai
Copy link
Author

retinfai commented Mar 4, 2023

It's more like it's incomplete. I don't convert every field.

But for set pose specifically, it gets confusing for me when gz.msgs.Pose doesn't map one to one to anything in the ROS side, so want to know the best practice for mapping 1 to N and vice versa. Set pose request (Entity and Pose on the ROS side) map to gazebo Pose but not all fields in Entity and Pose are used, so I exclude them. That sort of thing

I'm glad it works on your side. Now that I think about it, you're right: just need to iron out some things

@Mildred34
Copy link

I was wondering how to set the location of an entity spawned within Gazebo Garden.
But it's not officially supported.

@azeey
Copy link
Contributor

azeey commented Mar 8, 2023

I was wondering how to set the location of an entity spawned within Gazebo Garden. But it's not officially supported.

This is definitely supported. Checkout the message definition https://github.com/gazebosim/gz-msgs/blob/gz-msgs9/proto/gz/msgs/entity_factory.proto#L65

@Mildred34
Copy link

@azeey Looks like during spawn only by reading at the comment.
I was thinking about setting (or resetting) the location afterwards.

@retinfai
Copy link
Author

retinfai commented Mar 9, 2023

@azeey Looks like during spawn only by reading at the comment.

I was thinking about setting (or resetting) the location afterwards.

If you're talking about the bridge supporting you're correct.

But if you're talking about gazebo supporting it, gazebo does have a /model//set_pose service or something similar. You can call from a process

@Mildred34
Copy link

@retinfai I'm not an expert but to call a gazebo service from a ros node, I need the bridge support ?
If not, I'm going to investigate inside the set_pose service, you mentionned !

@retinfai
Copy link
Author

retinfai commented Mar 9, 2023

@retinfai I'm not an expert but to call a gazebo service from a ros node, I need the bridge support ?

If not, I'm going to investigate inside the set_pose service, you mentionned !

That's correct, calling the service from a Ros node does require bridge support . Just wanted to clarify.

In saying that, you can pull the fork, which does support it, while I fix issues and create a PR

@Mildred34
Copy link

@retinfai Yes I'll do that! Thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

4 participants