Multi-Agent simulation causing trouble in Rviz
I'm trying multi-agent simulations using ROSBOT 2.0 by husarion. I'm comfortable with single agent but when it comes to multiple agents I'm able to spawn them and control them independently but the problem comes with Rviz. I'm unable to visualize the robot in Rviz. It spwans upside down, i'm unable to see the camera feed and lidar output but the topics are present in the rostopic list.
The below is the launch file which I run.
<launch>
<arg name="world_name" default="worlds/empty.world"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world_name)"/> <!-- world_name is wrt GAZEBO_RESOURCE_PATH environment variable -->
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="false"/>
<arg name="debug" value="true"/>
<arg name="verbose" value="true"/>
</include>
<include file="$(find rosbot_gazebo)/launch/multi_rosbot.launch"/>
</launch>
Below is multi_rosbot.launch file.
<launch>
<param name="robot_description" command="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>
<!-- BEGIN ROBOT 1-->
<group ns="rover1">
<param name="tf_prefix" value="rover1" />
<include file="$(find rosbot_gazebo)/launch/rosbot_empty_world.launch" >
<arg name="init_pose" value="-x 0 -y 0 -z 0" />
<arg name="robot_name" value="rover1" />
</include>
</group>
<!-- BEGIN ROBOT 2-->
<group ns="rover2">
<param name="tf_prefix" value="rover2" />
<include file="$(find rosbot_gazebo)/launch/rosbot_empty_world.launch" >
<arg name="init_pose" value="-x -2 -y 0 -z 0" />
<arg name="robot_name" value="rover2" />
</include>
</group>
<!-- BEGIN ROBOT 3 -->
<group ns="rover3">
<param name="tf_prefix" value="rover3" />
<include file="$(find rosbot_gazebo)/launch/rosbot_empty_world.launch" >
<arg name="init_pose" value="-x -4 -y 0 -z 0" />
<arg name="robot_name" value="rover3" />
</include>
</group>
</launch>
Below is the rosbot_empty_world.launch
<launch>
<arg name="init_pose"/>
<arg name="robot_name"/>
<param name="robot_description" command="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>
<arg name="model" default="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>
<node name="rosbot_spawn" pkg="gazebo_ros" type="spawn_model" ns="/$(arg robot_name)"
args="$(arg init_pose) -unpause -urdf -model $(arg robot_name) -param /robot_description " respawn="false" output="screen"/>
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher" ns="/$(arg robot_name)" args="--namespace=/$(arg robot_name)">
<param name="publish_frequency" type="double" value="30.0" />
<param name="tf_prefix" value="/$(arg robot_name)" type="str"/>
</node>
<rosparam command="load" file="$(find joint_state_controller)/joint_state_controller.yaml" ns="/$(arg robot_name)"/>
<node name="controller_spawner_$(arg robot_name)" pkg="controller_manager" type="spawner" ns="/$(arg robot_name)"
respawn="false" args=" joint_state_controller --namespace=/$(arg robot_name)" output="screen"/>
</launch>
I cannot visualize anything in Rviz. Therobot spawns upside down, the camera is blank.
Here's the rostopic list output.
wally1002@wally:~$ rostopic list
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/rosout
/rosout_agg
/rover1/camera/depth/camera_info
/rover1/camera/depth/image_raw
/rover1 ...