amcl not publishing map -> odom under different namespace

asked 2019-07-01 13:27:18 -0500

Lemonaidan gravatar image

Hello,

I'm attempting to setup a pair of turtlebots that can run simultaneously, and in order to do so, they need to run their nodes on different namespaces while both subscribing to a shared /map topic. I've essentially been trying to apply this guide to real turtlebots. However, I've been facing this issue where amcl is not publishing from map -> odom even though it has all of its necessary prerequisites. I've narrowed it down to being an issue of the namespace change since I am able to run essentially the same code with no issue when the topics don't have a namespace argument in front. I've been trying to figure out where the loose end is but have so far been unsuccessful. My launch files are below:

multi.launch

<launch>
  <param name="/use_sim_time" value="false"/>
  <node pkg="map_server" type="map_server" name="map_server" args="/home/nvidia/maps/serc.yaml">
    <param name="frame_id" value="/map"/>
  </node>

  <include file="/home/nvidia/Desktop/launch/multi_nav.launch">
    <arg name="robot_name" value="robot1" />
  </include>

</launch>

multi_nav.launch

<launch>
  <arg name="robot_name"        default="robot1"/>

<group ns="$(arg robot_name)">
  <arg name="viz"       default="false"/>
  <arg name="base"          default="$(optenv TURTLEBOT_BASE kobuki)"/>  <!-- create, rhoomba -->
  <arg name="stacks"        default="$(optenv TURTLEBOT_STACKS hexagons)"/>  <!-- circles, hexagons -->
  <arg name="3d_sensor"     default="$(optenv TURTLEBOT_3D_SENSOR kinect)"/> <!-- kinect, asus_xtion_pro -->
  <arg name="serialport"        default="$(optenv TURTLEBOT_SERIAL_PORT)"/>

  <param name="tf_prefix" value="$(arg robot_name)"/>

<!--  ***************** Robot Model *****************  -->
<include file="$(find turtlebot_bringup)/launch/includes/robot.launch.xml">
  <arg name="base" value="$(arg base)" />
  <arg name="stacks" value="$(arg stacks)" />
  <arg name="3d_sensor" value="$(arg 3d_sensor)" />
</include>
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
  <param name="use_gui" value="false"/>
</node>

<!-- Command Velocity multiplexer -->
<node pkg="nodelet" type="nodelet" name="mobile_base_nodelet_manager" args="manager"/>

<node pkg="nodelet" type="nodelet" name="mobile_base" args="load kobuki_node/KobukiNodelet mobile_base_nodelet_manager">
  <rosparam file="$(find kobuki_node)/param/base.yaml" command="load"/>
  <param name="odom_frame" value="$(arg robot_name)/odom"/>
  <param name="base_frame" value="$(arg robot_name)/base_footprint"/>
  <param name="device_port" value="$(arg serialport)" />

  <remap from="mobile_base/odom" to="/$(arg robot_name)/odom"/>
<!-- Don't do this - force applications to use a velocity mux for redirection  
  <remap from="mobile_base/commands/velocity" to="cmd_vel"/> 
-->
  <remap from="mobile_base/enable" to="enable"/>
  <remap from="mobile_base/disable" to="disable"/>
  <remap from="mobile_base/joint_states" to="/$(arg robot_name)/joint_states"/>
</node>

<node pkg="nodelet" type="nodelet" name="cmd_vel_mux" args="load yocs_cmd_vel_mux/CmdVelMuxNodelet mobile_base_nodelet_manager">
  <param name="yaml_cfg_file" value="$(find turtlebot_bringup)/param/mux.yaml"/>
  <remap from="cmd_vel_mux/output" to="mobile_base/commands/velocity"/>
</node>

<include file="$(find turtlebot_bringup)/launch/includes/kobuki/bumper2pc.launch.xml"/>

<!--  ************** Navigation  ***************  -->
<!--include file="$(find turtlebot_navigation)/launch/includes/move_base.launch.xml"/-->

<!-- rosrun tf static_transform_publisher 0 0 0 0 0 0 base_ftprint laser 100 -->
<node pkg ...
(more)
edit retag flag offensive close merge delete

Comments

What does your TF tree look like?

AndreasLydakis gravatar imageAndreasLydakis ( 2019-07-11 03:35:24 -0500 )edit