Gazebo | Ignition | Community
Ask Your Question

ROS2: ros_ray sensor does not default to link as frame_name

asked 2021-06-09 06:44:12 -0600

relffok gravatar image

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_linkas 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-->
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2022-06-18 15:02:23 -0600

Not really an answer but just 'ditto'.
It took me hours to find out why the laser output looked like the scanner (in the video, the small round object on the top of the robot, above the axel) created output like it is off-center: Thank for the observation as it explains why setting frame_name solved my issue.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2021-06-09 06:44:12 -0600

Seen: 709 times

Last updated: Jun 18 '22