Hector Trajectory Path is not smooth

asked 2021-08-18 13:38:42 -0500

cirbeus gravatar image

updated 2021-08-19 10:52:48 -0500

Hi! Quick intro: I am using ROS Melodic on Ubuntu 18.04 with kernel 5.4.0-74-generic.

My goal is to produce a map in RViz using PointCloud2 data from a rosbag file.

  • I decided to use the pointcloud_to_laserscan package to convert the PointCloud2 data to LaserScan data. However, the PointCloud2 data is visualised on the z-axis in its front_color_optical_frame and so, I chose to rotate the PointCloud2 data on to the x-axis using a static_transform_publisher, and publish the /scan topic within the resulting orient_frame. The launch file made to do this is written below:

<param name="/use_sim_time" value="true"/>

<arg name="bagfile" default="/home/cirbeus/bagfiles/scout8_accel.bag"/>

<!-- play bagfile -->
<node pkg="rosbag" type="play" name="rosbag_player" output="screen" 
    args="--clock $(arg bagfile)"/>

<!-- convert -->
<node pkg="pointcloud_to_laserscan" type="pointcloud_to_laserscan_node" 
    name="pointcloud_to_laserscan" output="screen">
    <remap from="cloud_in" to="/iris/front/camera/depth/color/points"/>
    <!-- create laser_scan in this frame's orientation -->
        target_frame: orient_frame 

<!-- transform z-axis of pointcloud -->
<node pkg="tf" type="static_transform_publisher" name="z_axis_tf" 
    args="0 0 0 0 0 -1.65 orient_frame front_color_optical_frame 100"/>

<include file="$(find p2l)/launch/p2l_mapping.launch"/>    
  • With the LaserScan data published at the desired orientation, I move on to using the hector_mapping package (as I lack any /odom data) and find that the trajectory path is jagged and not smooth. With reference to a similar problem, my guess would be that the PointCloud2 orientation done earlier would be the cause for this, else I am not sure how to proceed. The launch file (p2l_mapping.launch) used to do this is written below:


<node pkg="rviz" type="rviz" name="rviz" 
    args="-d $(find p2l)/launch/config_mapping.rviz"/>

<include file="$(find hector_mapping)/launch/mapping_default.launch">
  <arg name="base_frame" value="orient_frame"/>
  <arg name="odom_frame" value="orient_frame"/>
  <arg name="pub_map_odom_transform" value="true"/>
  <arg name="scan_subscriber_queue_size" value="25"/>

<include file="$(find hector_geotiff)/launch/geotiff_mapper.launch">
  <arg name="trajectory_source_frame_name" value="orient_frame"/>

<node pkg="tf" type="static_transform_publisher" name="orient_to_laser_tf" 
    args="0 0 0 0 0 -1.65 orient_frame laser 100"/>


If anyone has even a clue as to why the results are so skewed and/or how to solve it, please do not hesitate to respond! Any clarification and/or guidance is greatly appreciated :D

All links mentioned: pointcloud2_z-axis, pointcloud2_x-axis, laserscan, trajectory_path, similar_problem

edit retag flag offensive close merge delete