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

laser pattern does not appear when global Fixed Frame = odom

asked 2022-02-20 14:26:54 -0600

RH56 gravatar image

I have installed the rplidar A3 and it functions fine in RViz when testing with the proper command in the terminal.

When I activate the laser with my launch file, and set the global fixed frame to 'odom' (fixed frame connected with the world), then the laser pattern disappears . All the rest Rviz works fine, when I move the robot, the base_link moves accordingly.

Anyone can tell me what I have to change or add in order to see the laser pattern?

I just see I am not allowed to add a print-screen picture, so here are the most important settings:

  • Global options: Fixed Frame: odom

  • Grid: Fixed Frame odom

  • RPLidarLaser Topic: /scan, style: squares, size: 0.03, Position Transformer and Color Transformer are blanked out and cannot be selected

  • Axes: Reference Frame: base_link

When I set the global fixed frame to laser, then the laser pattern appears but then, of course, the world is connected with the lidar, which is not the idea.

My urdf file:

<?xml version="1.0"?>

    <robot name="robot"> 

      <link name="base_link"> <!-- the Vehicle -->
        <visual>
          <geometry>
            <box size="0.6 0.6 0.2"/> <!-- vehicle shape -->
          </geometry>
           <origin rpy="0.0 0.0 0.0" xyz="0.05 0 -0.1"/> <!-- origin = middle between wheels -->
        </visual>
      </link>


     <link name="laser">  <!-- the Laser -->
       <visual>
         <geometry>
           <cylinder length="0.03" radius="0.05"/> <!-- laser shape -->
         </geometry>
         <origin rpy="0 0 0" xyz="0.3 0 0.2"/> <!-- origin = cilinder center -->
       </visual>
     </link>


     <joint name="base_link_to_laser" type="fixed"> <!-- laser pos relative to vehicle -->
       <parent link="base_link"/>
       <child link="laser"/>
       <origin xyz="0 -0.22 0.25" rpy = "0 0 0" />
     </joint>

   </robot>

Thanks a lot

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2022-02-25 12:35:28 -0600

updated 2022-02-25 12:36:19 -0600

According to ROS REP-105, there are two frames recommended for navigation; map and odom. The difference between them is that the odom frame may drift over time (which makes it useless for long-term reference) whereas the map frame should not drift over time but maybe noncontinuous (may cause discrete jumps) in the short term.

You will have to create a link from map -> odom -> base_link to get all the transforms working properly. From your urdf file, it is clear that you are creating a link between base_link and laser, but ROS has no idea how to get from base_link to odom (and map in the future).

I recommend using a package like robot_localization in your setup to get odometry information and take care of these transforms for you. If you choose not to, you can also calculate the transforms manually but make sure you publish them to the tf tree. You can use tools such as rqt_tf_tree to ensure these transforms exist.

edit flag offensive delete link more

Comments

thanks a lot, Akhil.

RH56 gravatar image RH56  ( 2022-03-17 05:50:42 -0600 )edit
0

answered 2022-02-25 11:54:49 -0600

RH56 gravatar image

I have now started up the laser by means of launch files that I copied and adapted from the nox robot. For some reason it now works. I can put the fixed frame to either odom or maps and the laser pattern appears in both cases.

edit flag offensive delete link more
0

answered 2022-02-23 09:14:01 -0600

bribri123 gravatar image

you need to change your fixed frame to laser

edit flag offensive delete link more

Comments

Thanks, Briri. It works fine with the fixed frame to 'laser', but in the end, I will have to set the fixed frame to 'maps' in order to navigate. So, how am I going to deal with that if it only works with the fixed frame to 'laser' ? Or is there another way?

RH56 gravatar image RH56  ( 2022-02-23 10:48:34 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-02-20 14:26:26 -0600

Seen: 451 times

Last updated: Feb 25 '22