Robotics StackExchange | Archived questions

Is it possible to spawn or update a model with a new link and plugin?

I've been using spawn_entity.py in gazebo_ros for ROS2 to try to spawn a new camera. I really want this camera rigidly attached to a model that's already spawned in gazebo. I thought I could do this by spawning a new model with a joint from an existing base link but then I realized that doesn't make sense. Is there any way to spawn just a new link with a joint referenced from an existing model/entity?

I'm beginning to think that really the only way to do this is to remove the existing model and respawn it from a xacro that has the model updates I want. If that's true, then is there anything I should look out for to make sure there are no conflicts from the previous model? For example, this model will be receiving a twist message to keep it moving.

Asked by jeremya on 2021-04-26 17:06:58 UTC

Comments

I'm wondering whether it would be better to post this on Gazebo Answers.

It's clear there is a ROS side to this, but whether the ROS integration plugin(s) are capable of this is largely determined by the support in Gazebo for this (ie: without Gazebo supporting it, the plugins couldn't do it either).

At the very least, you'll have a better chance of getting eyes on your question from the Gazebo developer community.

Asked by gvdhoorn on 2021-04-27 03:12:25 UTC

You make a good point. I'll repost there.

Asked by jeremya on 2021-04-27 18:04:46 UTC

Did you find any solution for your problem? I'm trying to do exactly the same, but haven't found a solution yet. (I didn't find your repost on Gazebo Answers).

Asked by hsil on 2022-05-11 00:57:03 UTC

Sorry. I didn't post in Gazebo answers yet. Feel free to do so. I basically decided to add it to the Xacro and use parameters to move it around for each time I spawned the entire model.

Asked by jeremya on 2022-06-22 15:39:48 UTC

Answers

This would be a neat feature, but I don't believe Gazebo/ROS have the capability (as of yet) to ad-hoc model descriptions to each other. Possible reason is that even if you match the and name spaces across the two model files, there is no plug-in that treats them as parent-child. Unless I misunderstood that you are just looking to re-spawn an updated model in place of the current model instance..

I would be curious if such a custom plugin can be written for Gazebo?
Otherwise, moveit2/Rviz have features for dynamic end-effector changes.

Asked by rotaryopt on 2021-04-27 02:23:19 UTC

Comments