Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ROS2: ros_ray sensor does not default to link as frame_name

When using the ray_laser_plugin and a fixed joint, the frame_link of the sensor defaults to the main link of the robot base_footprint not the actual link laser_link as described here:

I created a minimal robot xacro example that can be spawned into gazebo. Its fairly simple to not clutter the file. The scan topic itself is correctly published but the reference frame is not set. If I leave out the frame_name element the scan is referenced in the base_footprint frame, not the laser_link frame.

I don't really have a question, since I know how to fix it but I am wondering if this is intended behavior. When using fixed link poses instead of fixed joints the default to the laser_link works.

I am using ros2 foxy (gazebo_ros_pkgs 3.5.3) with Gazebo 11.5

<?xml version="1.0" ?>
<robot name="my_robot">
  <link name="base_footprint"/>
  <joint name="base_joint" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
    <origin rpy="0 0 0" xyz="0 0 0.25"/>
  <link name="base_link">
      <mass value="48.0"/>
      <origin rpy="0 0 0" xyz="0.03 0 0.20"/>
      <inertia ixx="2.0" ixy="0.0" ixz="0.0" iyy="4.3" iyz="0.0" izz="5.5"/>
      <origin rpy="0 0 0" xyz="0.03 0 0"/>
        <box size= "0.5 0.5 0.5"/>
  <joint name="base_link_to_laser_joint" type="fixed">
    <parent link="base_link"/>
    <child link="laser_link"/>
    <origin rpy="0.0 0.0 0.5" xyz="0.25 0.25 0.25"/>
  <link name="laser_link">
      <origin rpy="0 0 0" xyz="0.03 0 0"/>
        <box size= "0.1 0.1 0.1"/>
  <gazebo reference="laser_link">
    <sensor name="laser_link" type="ray">
      <plugin filename="" name="gazebo_ros_laser_link_controller">
        <!-- when leaving away frame_name it defaults to base_footprint instead-->