Multiple robots simulation and joint_state_publisher

asked 2021-12-26 13:46:23 -0500

NelsonBilber gravatar image

Hi,

I have follow the recommended instructions for operate multiple-robots having has base the same URDF and diferent tf_prefix Here

Also setup the acml files and move_base for each robot and the robots move when is assigned a goal. However my URDF model has joints and I can't set it correctly. When I start the launch the program the nodes seam to be corrected

` gazebo (gazebo_ros/gzserver)

gazebo_gui (gazebo_ros/gzclient)

map_server (map_server/map_server)

move_base (move_base/move_base)

move_base2 (move_base/move_base)

robot1_amcl (amcl/amcl)

robot2_amcl (amcl/amcl)

rviz (rviz/rviz)

/robot1/

joint_pub (joint_state_publisher/joint_state_publisher)

robot_state_publisher (robot_state_publisher/state_publisher)

spawn_minibot_model (gazebo_ros/spawn_model)

/robot2/

joint_pub (joint_state_publisher/joint_state_publisher)

robot_state_publisher (robot_state_publisher/state_publisher)

spawn_minibot_model (gazebo_ros/spawn_model)

`

The in the process of starting the ROS or gazebo kill the process and give the following error:

Traceback (most recent call last): File "/opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher", line 44, in <module> jsp = joint_state_publisher.JointStatePublisher() File "/opt/ros/melodic/lib/python2.7/dist-packages/joint_state_publisher/__init__.py", line 145, in __init__ raise RuntimeError('The robot_description parameter is required and not set.') RuntimeError: The robot_description parameter is required and not set. [robot1/joint_pub-5] process has died [pid 16135, exit code 1, cmd /opt/ros/melodic/lib/joint_state_publisher/joint_state_publisher __name:=joint_pub __log:=/home/nbr/.ros/log/a94beea4-6678-11ec-8133-00155db860b1/robot1-joint_pub-5.log]. log file: /home/nbr/.ros/log/a94beea4-6678-11ec-8133-00155db860b1/robot1-joint_pub-5*.log

main lunch file

 <launch>
      <!-- include our robots -->
      <include file="$(arg pkg)/launch/robots.launch"/>
 </launch>

robot launch file

 <launch>
 <!-- parameters -->
     <param name="robot_description" command="xacro '$(find myproject)/urdf/mymodel.urdf.xacro'"/> 
     <!-- BEGIN ROBOT 1-->
      <group ns="robot1">
           <param name="tf_prefix" value="robot1_tf" />
           <include file="$(find myproject)/launch/one_robot.launch" >
          <arg name="init_pose" value="-x 3 -y 1 -z 0" />
           <arg name="robot_name"  value="Robot1" />
        </include>
     </group>
     <!-- BEGIN ROBOT 2-->
     <group ns="robot2">
         <param name="tf_prefix" value="robot2_tf" />
         <include file="$(find myproject)/launch/one_robot.launch" >
         <arg name="init_pose" value="-x -4 -y 1 -z 0" />
         <arg name="robot_name"  value="Robot2" />
        </include>
      </group>
      <!-- Run the map server -->
      <node name="map_server" pkg="map_server" type="map_server" args="$(find myproject)/config/my_map.yaml" >
       <param name="frame_id" value="map" />
      </node>
      <!-- Properties of each robot      -->
      <!-- AMCL      -->
      <include file="$(find myproject)/launch/amcl_robot1.launch" />
      <include file="$(find myproject)/launch/amcl_robot2.launch" /> -->
      <!-- MOVE_BASE-->
       <include file="$(find myproject)/launch/move_base_1.launch" />
       <include file="$(find myproject)/launch/move_base_2.launch" /> -->
       <node name="rviz" pkg="rviz" type="rviz" args="-d $(find myproject)/rviz/navigation.rviz" />-
 </launch>

one robot - launch file

`<launch> <arg name="robot_name"/> <arg name="init_pose"/>

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

<!-- Problem here !!!!!! !-->
 <node name="joint_pub" pkg="joint_state_publisher" type="joint_state_publisher"/>

<node pkg="robot_state_publisher" type="state_publisher" name="robot_state_publisher" output="screen"/>

</launch>

I don't understand the problem because the robot_description is defined ... (more)

edit retag flag offensive close merge delete