Hector Trajectory Path is not smooth
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 thePointCloud2
data toLaserScan
data. However, thePointCloud2
data is visualised on the z-axis in itsfront_color_optical_frame
and so, I chose to rotate thePointCloud2
data on to the x-axis using astatic_transform_publisher
, and publish the/scan
topic within the resultingorient_frame
. The launch file made to do this is written below:
<launch>
<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 -->
<rosparam>
target_frame: orient_frame
</rosparam>
</node>
<!-- 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"/>
</launch>
- With the
LaserScan
data published at the desired orientation, I move on to using thehector_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 thePointCloud2
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:
<launch>
<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>
<include file="$(find hector_geotiff)/launch/geotiff_mapper.launch">
<arg name="trajectory_source_frame_name" value="orient_frame"/>
</include>
<node pkg="tf" type="static_transform_publisher" name="orient_to_laser_tf"
args="0 0 0 0 0 -1.65 orient_frame laser 100"/>
</launch>
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