ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

When ever I try to put my turtlebot2(simulated in gazebo) into a namespace the fake laser stops publishing messages on /scan

asked 2015-08-27 02:16:53 -0500

Usman Arif gravatar image

I am trying to put multiple turtlebots in my simulation and need to declare group namespaces for this purpose. When defined within the namespace the robot_state_publisher published all the transforms under the new namespace but the fake laser first of all does not follow the namespace the /scan topic remains /scan and 2nd it even stops getting any message at /scan which is working fine without the group namespace declared. Below is my launch file

<launch> <arg name="world_file" default="$(env TURTLEBOT_GAZEBO_WORLD_FILE)"/> <arg name="base" value="$(optenv TURTLEBOT_BASE kobuki)"/> <arg name="battery" value="$(optenv TURTLEBOT_BATTERY /proc/acpi/battery/BAT0)"/> <arg name="stacks" value="$(optenv TURTLEBOT_STACKS hexagons)"/> <arg name="3d_sensor" value="$(optenv TURTLEBOT_3D_SENSOR kinect)"/>

<include file="$(find gazebo_ros)/launch/empty_world.launch"> <arg name="use_sim_time" value="true"/> <arg name="debug" value="false"/> <arg name="world_name" value="$(arg world_file)"/> </include>

<group ns="robot1"> <include file="$(find turtlebot_gazebo)/launch/includes/$(arg base).launch.xml"> <arg name="base" value="$(arg base)"/> <arg name="stacks" value="$(arg stacks)"/> <arg name="3d_sensor" value="$(arg 3d_sensor)"/> </include>

<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher"> </node>

<node pkg="nodelet" type="nodelet" name="laserscan_nodelet_manager" args="manager"/> <node pkg="nodelet" type="nodelet" name="depthimage_to_laserscan" args="load depthimage_to_laserscan/DepthImageToLaserScanNodelet laserscan_nodelet_manager"> <remap from="image" to="/camera/depth/image_raw"/> <remap from="scan" to="/scan"/> </node> </group> </launch>

I want my /scan topic to be published under /robot1/scan so that I could add in multiple robots all publishing their own scans.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-09-02 19:01:50 -0500

jihoonl gravatar image

There is remapping rule in laserscan_nodelet_manager.

<remap from="scan" to="/scan"/>

You may want to remove this.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-08-27 02:16:53 -0500

Seen: 392 times

Last updated: Sep 02 '15