Launching two UR16e in Gazebo and Rviz

Hello Community,

My plan is to launch two UR16e in gazebo. I am working with ROS Noetic on Ubuntu 20.04. I am able to launch the robots, but I can not get a connection between Rviz and gazebo. I followed the instruction of the Live Class #68 How to Control 2 Arm Robots with Moveit.

Thank you for the help!

<arg name="robot_x"   default="0.0" />
<arg name="robot_y"   default="0.0" />
<arg name="robot_z"   default="0.10" />
<arg name="robot_yaw" default="0.0" />
<arg name="init_pose" default="-x $(arg robot_x) -y $(arg robot_y) -Y $(arg robot_yaw) -z $(arg robot_z) "/>
<arg name="robot_name" default="ur"/>
<arg name="tf_prefix"    default="" />    

<arg name="transmission_hw_interface" default="hardware_interface/PositionJointInterface" />

<arg if="$(eval tf_prefix=='')" name="tf_prefix_slashed" value="" /> <!--Important for proper substitution (empty tf_prefix must not lead to leading slashes-->
<arg unless="$(eval tf_prefix=='')" name="tf_prefix_slashed" value="$(arg tf_prefix)/" /> <!--Important for proper substitution (empty tf_prefix must not lead to leading slashes-->

<param name="robot_description" 
    command="$(find xacro)/xacro $(find ur_description)/urdf/ur16e.xacro transmission_hw_interface:=$(arg transmission_hw_interface)  tf_prefix:=$(arg tf_prefix)"/> 

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" 
        args="-urdf -param robot_description -model $(arg robot_name) $(arg init_pose)" 
        respawn="false" output="screen"/>          

 <!-- Start the controllers -->
<rosparam file="$(find ur_launch_sim)/config/gazebo_joint_state_controller.yaml" command="load"/>
<node name="controller_spawner" pkg="controller_manager" type="controller_manager" output="screen"
    args="spawn joint_state_controller">
</node>


 <!-- Robot state publisher -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" output="screen">
    <param name="tf_prefix" value="$(arg tf_prefix)"/>
</node>

Hi, welcome to the community!

What do you mean by getting a connection between rviz and gazebo? Are you able to launch and view the simulation? Is it offering topics like /tf or the controller ones that you are launching in your file?

If so, then you should be able to run rviz and start configuring it, adding things like TF and RobotModel if you have one, which I assume you do because that URDF is what you are spawining in gazebo

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.