Closed unravelwool closed 4 years ago
You should check that the world you are using have the ros_interface_plugin.
Thank you so much for your help!! I find that there is no gazebo_ros_interface_plugin in the.world
file. So I add the following line to my.world
file:
<plugin name="ros_interface_plugin" filename="librotors_gazebo_ros_interface_plugin.so"/>
and run the env1.launch
file, I find the ros imu topic appears !! It works fine!! 💃:D
But I still have a question. I want simulate several UAVs in the Gazebo. So I add serveral erlecopter_base.xacro
into the <group>
tag in the .launch file. Thus the Gazebo should spawn several erlecopter models, and each erlecopter model has an imu sensor. These imu sensor should create several imu ros topics, each of which has an different topic name from others. Can only one gazebo_ros_interface_plugin achieve the creation of several imu ros topics ?
If not, Can I use several gazebo_ros_interface_plugins in a .world file in the following way:
<plugin name="ros_interface_plugin_1" filename="librotors_gazebo_ros_interface_plugin.so"/>
<plugin name="ros_interface_plugin_2" filename="librotors_gazebo_ros_interface_plugin.so"/>
<plugin name="ros_interface_plugin_3" filename="librotors_gazebo_ros_interface_plugin.so"/>
......
I look forward to hearing from you! :)
with regard to the number of gazebo_ros_interface_plugin in empty.world, one is enough, because the topics which have same functionalities in different uavs are created with different name prefixs. It does not cause any confusion.
Hi, everyone ! I am using the ardupilot_sitl_gazebo_plugin to simulate the uav. My uav is Erlecopter which is described in
erlecopter_base.xacro
. This file uses the gazebo_imu_plugin from rotors_gazebo_plugin to produce imu data on the imu ros topic. Theerlecopter_base.xacro
uses the<xacro: imu_plugin_macro>
which comes fromcomponent_snippets.xacro
in the following way:in the above lines, I set imu_topic to "imu_ABCDEFG". And the part about imu in the
component_snippets.xacro
is as follows:When I launch the “env1.launch” which I write by myself. I can find the imu gazebo topic like that:
But I do not find the imu ros topic. This may be an error. I think the gazebo_imu_plugin should publish the imu data on an imu ROS topic , but the imu ROS topic is missing !
Anyone can help me and tell what it happened. I wonder if the gazebo_imu_plugin in rotors_gazebo_plugins can create an imu ros topic and publish imu data to it. If the gazebo_imu_plugin can't create an imu ROS topic , what should I do for this? I find that default sensor plugins in Gazebo are able to create a ROS topic and publish sensor data to it. Your help will be greatly appreciated !!
yours sincerely unravelwool