How to spawn multiple clone of model using msg::Factory?
I am using model spawner according this world plugin tutorial with option number three using msg::factory
transport::NodePtr node(new transport::Node());
node->Init(_parent->Name());
transport::PublisherPtr factoryPub =
node->Advertise<msgs::Factory>("~/factory");
msgs::Factory msg;
msg.set_sdf_filename("model://cylinder");
msgs::Set(msg.mutable_pose(),
ignition::math::Pose3d(
ignition::math::Vector3d(1, -2, 0),
ignition::math::Quaterniond(0, 0, 0)));
factoryPub->Publish(msg)
I use this option because it let me set the spawn position. My problem is I do not know how to spawn another clone with same SDF model file using this method, I tried call factoryPub->Publish(msg)
again but it seem gazebo only spawn a model per SDF model file.
Can you include the version of Gazebo you are using?
@nkoenig, already in the tag