Gazebo | Ignition | Community
Ask Your Question
1

Parameterizing elements of an SDF model

asked 2014-10-16 14:47:01 -0600

nckswt gravatar image

I'm new to Gazebo and I've been trying to create a SDF model for a general wall I'll be using in a Vicon space. I'm using aau gazebo vicon to modify the pose of my wall model, but, because I have eight walls, I need to figure out how to parameterize the ros topic they listen to.

Specifically, the code I'm trying to modify is:

<plugin name="ros_transform" filename="/home/cohrint/catkin_ws/devel/lib/libros_transform.so">
  <targetLink>wall</targetLink>
  <transformTopic>/vicon/Wall1/Wall1</transformTopic>
</plugin>

How can I change <transformTopic>/vicon/Wall1/Wall1</transformTopic> to <transformTopic>/vicon/Wall(n)/Wall(n)</transformTopic> where (n) is the nth wall loaded into gazebo?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-10-19 04:05:55 -0600

scpeters gravatar image

I have recently been using embedded ruby (erb) to parameterize sdf models. Here's an example of a parameterized vehicle model using erb. For that example I use erb model.rsdf > model.sdf to generate the model.sdf file.

edit flag offensive delete link more

Comments

1

Hmm, that won't quite work for me. I'd rather not have a different model for each wall, I was hoping to simply have one model that reads from a ROS Topic based on, say, the object name or the order in which the object was created.

nckswt gravatar imagenckswt ( 2014-10-20 15:55:18 -0600 )edit

@nckswt Although I agree with you on not duplicating SDF files, its challenge is explained here by @scpeters, which I don't quite understand but I just took it as a compelling reason.

IsaacS gravatar imageIsaacS ( 2015-07-03 17:39:47 -0600 )edit

Question Tools

Stats

Asked: 2014-10-16 14:47:01 -0600

Seen: 1,958 times

Last updated: Oct 19 '14