Declare and pass parameters in SDF files while spawning models

asked 2022-02-20 12:36:39 -0500

mihirk284 gravatar image

updated 2022-02-21 03:17:26 -0500

Hi all, I am trying to spawn and use robots using ROS launch files in Ignition Fortress. I am using a launch file to spawn a model in an already-created world as shown below:-

image description

For doing this I would like to spawn my robots and the plugins that control the robot (multirotor in my case). I could not find a way to specify the name of the plugins via the launch file.

I am looking at something similar in use to the way xacro is used inside rotors_simulator. For example here.

I wanted to ask if there is a way to name the plugins with the same name as my robot similar to this, shown below, but allowing the passing of parameters into using the launch file:- image description

Is there any way to be able to do this? I have seen some examples of the osrf/subt using ERB and initializing plugin names based on the robotName parameter in the spawner.rb files for this purpose. I'm extremely confused while using that and am not able to get it to work independently. It would be really helpful if someone could point me to a tutorial that would allow me to dynamically initialize the names of plugins, or robots based on the parameters passed.

Edit: If anyone could also point me to a sample package to use ERB files, it would be immensely helpful.

edit retag flag offensive close merge delete

Comments

Any updates on this? I also want to pass parameters to a sdf when spawning it

rezenders gravatar imagerezenders ( 2022-06-13 07:56:44 -0500 )edit