How to remove the namespace of tf published by gazebo sensor plugin?

asked 2021-05-09 07:20:40 -0500

Epsilon_cm gravatar image

updated 2021-05-11 08:07:29 -0500

I spawn a robot called robuster, which has a ray sensor. The sensor's gazebo reference is "livox_base".However, in tf_tree, gazebo publish a "robuster::livox_base" tf so that the tree has two roots. How to remove the namespace "robuster?"image description

As the suggestion by skpro19, it's my launch file

<launch>
<arg name="model" default="waffle_pi" doc="model type [burger, waffle, waffle_pi]"/>
<arg name="x_pos" default="1"/>
<arg name="y_pos" default="-8"/>
<arg name="z_pos" default="0.0"/>
<arg name="roll" default="0"/>
<arg name="pitch" default="0"/>
<arg name="yaw" default="1.57"/>
<arg name="use_ekf_localization" default="false" />
<arg name="world" default="$(find active_mapping)/worlds/house.world" />
<arg name="robot_urdf" default="$(find active_mapping)/urdf/robuster_horizon.urdf.xacro" />
<remap to="cmd_vel" from="mr1000_velocity_controller/cmd_vel"/>
<!-- <remap to="odom" from="mr1000_velocity_controller/odom"/> -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world)"/>
<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="false"/>
</include>

<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg robot_urdf)" />

<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-urdf -model robuster -x $(arg x_pos) -y   $(arg y_pos) -z $(arg z_pos) -Y $(arg yaw) -param robot_description" />

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher">
  <param name="publish_frequency" type="double" value="30.0" />    
</node>


<rosparam file="$(find active_mapping)/config/robuster_horizon/crank_gazebo_control.yaml" command="load"/>
<rosparam file="$(find active_mapping)/config/robuster_horizon/diff_drive_control.yaml" command="load"/>
<node name="car_controller_spawner" pkg="controller_manager" type="spawner" ns="/"
  args="mr1000_velocity_controller crank_joint_position_controller mr1000_joint_publisher"/>

<group if="$(arg use_ekf_localization)">
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization">
    <rosparam command="load" file="$(find active_mapping)/config/robuster_horizon/localization.yaml" />
  </node>
</group>

<group unless="$(arg use_ekf_localization)">
  <node pkg="active_mapping" type="odom_to_tf" name="odom_to_tf">
  </node>
</group>

   </launch>
edit retag flag offensive close merge delete

Comments

You might need to make some changes in the urdf file for the robot model.

Can you please share your launch file wherein you are spawning the bot in the Gazebo world?

skpro19 gravatar image skpro19  ( 2021-05-11 08:01:55 -0500 )edit

You might need to make some changes in the urdf file for the robot model.Can you please share your launch file wherein you are spawning the bot in the Gazebo world?

Yes.

Epsilon_cm gravatar image Epsilon_cm  ( 2021-05-11 08:08:02 -0500 )edit

Could you also share robuster_horizon.urdf.xacro file ?

skpro19 gravatar image skpro19  ( 2021-05-12 03:36:53 -0500 )edit

Yes, this is my robuster_horizon file: https://gist.github.com/EpsAvlc/c21df...

Epsilon_cm gravatar image Epsilon_cm  ( 2021-05-12 03:45:43 -0500 )edit

<xacro:include filename="$(find livox_laser_simulation)/urdf/livox_horizon.xacro"/>

Could you also share livox_horizon.xacro?

skpro19 gravatar image skpro19  ( 2021-05-12 03:52:18 -0500 )edit
Epsilon_cm gravatar image Epsilon_cm  ( 2021-05-12 05:14:23 -0500 )edit