Ask Your Question

Rotate a 2d LiDAR to build 3D map

asked 2019-04-26 16:42:30 -0500

tsdk00 gravatar image

Hi, I'm using a husky robot for my navigation which already has 2d LMS Lidar and I'm able to implement 2D SLAM algorithm on that. Now, instead of having two 2d Lidar, I wanted to rotate 2d lidar and get the 3d point cloud so that I can use Cartographer to build 3d maps. But before that, I need to set up the rotating joint and then attach the lidar to the rotating joint in the URDF of the robot. Does anyone know how to set up the rotating platform in the URDF and then attach the lidar to it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-07-01 02:43:56 -0500

tsdk00 gravatar image

I was able to build the 3d map by the help of a position joint controller and then using Rtab or Cartographer 3d to build the required 3d map.

To setup rotating 2d lidar make the joint continuous and add transmission

      <joint name="base_to_laser_joint" type="continuous">
        <axis xyz="0 1 0" />
        <origin xyz="0.150 0 0.097" rpy="-1.57 0 0"/>
        <parent link="top_plate"/>
        <child link="laser_link"/>


  <transmission name="base_to_laser_trans">
    <actuator name="motor1">
    <joint name="base_to_laser_joint">

To create the controller add the following config file for your robot accordingly and then call it to launch file

        type: joint_state_controller/JointStateController
        publish_rate: 20

        type: effort_controllers/JointPositionController
        joint: base_to_laser_joint
        pid: {p: 1.1, i: 1.0, d: 1.0}


<!-- loads the controllers -->
<rosparam file="$(find marvin_description)/config/rotating_laser_control.yaml" command="load" />
<node name="controller_spawner" pkg="controller_manager" type="spawner" ns="/marvin" args="base_to_laser_joint_position_controller joint_state_controller --shutdown-timeout 3"/>

Finally, publish position values to the position command and you can see the laser rotating smoothly. If not tune the PID dynamically for a smooth scan.

edit flag offensive delete link more


hi, how are the results ?, I plan to apply the same with an RPLIDAR to generate 3D maps, what package do you use for navigation, it would be helpful for me.

JESCAS gravatar image JESCAS  ( 2020-12-23 19:55:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2019-04-26 16:42:30 -0500

Seen: 599 times

Last updated: Jul 01 '19