Skip to content

Commit

Permalink
Added assert on PointCloud2 format (#560). rtabmap.launch: added gdb …
Browse files Browse the repository at this point in the history
…option for convenience.
  • Loading branch information
matlabbe committed Mar 28, 2021
1 parent e7dd6ca commit b9c7efd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions launch/config/husky_velodyne_extra.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<robot xmlns:xacro="http://ros.org/wiki/xacro">

<xacro:include filename="$(find velodyne_description)/urdf/VLP-16.urdf.xacro"/>
<VLP-16 parent="base_laser_mount" name="velodyne" topic="velodyne_points" gpu="true">
<xacro:VLP-16 parent="base_laser_mount" name="velodyne" topic="velodyne_points" gpu="true" organize_cloud="true">
<origin xyz="0.025 0 0.175" rpy="0 0 0" />
</VLP-16>
</xacro:VLP-16>

</robot>
6 changes: 4 additions & 2 deletions launch/rtabmap.launch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

<!-- -->
<launch>
<!-- Convenience launch file to launch odometry, rtabmap and rtabmapviz nodes at once -->

Expand Down Expand Up @@ -46,7 +46,9 @@
<arg name="wait_for_transform" default="0.2"/>
<arg name="args" default=""/> <!-- delete_db_on_start, udebug -->
<arg name="rtabmap_args" default="$(arg args)"/> <!-- deprecated, use "args" argument -->
<arg name="launch_prefix" default=""/> <!-- for debugging purpose, it fills launch-prefix tag of the nodes -->
<arg name="gdb" default="false"/> <!-- Launch nodes in gdb for debugging (apt install xterm gdb) -->
<arg if="$(arg gdb)" name="launch_prefix" default="xterm -e gdb -q -ex run --args"/>
<arg unless="$(arg gdb)" name="launch_prefix" default=""/>
<arg name="output" default="screen"/> <!-- Control node output (screen or log) -->
<arg name="publish_tf_map" default="true"/>

Expand Down
2 changes: 2 additions & 0 deletions src/MsgConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2149,6 +2149,8 @@ bool convertScan3dMsg(
int maxPoints,
float maxRange)
{
UASSERT(scan3dMsg.data.size() == scan3dMsg.row_step*scan3dMsg.height);

bool hasNormals = false;
bool hasColors = false;
bool hasIntensity = false;
Expand Down
3 changes: 2 additions & 1 deletion src/OdometryROS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ void OdometryROS::processData(SensorData & data, const std_msgs::Header & header
{
if(previousStamp_>0.0 && previousStamp_ >= header.stamp.toSec())
{
NODELET_WARN("Odometry: Detected not valid consecutive stamps (previous=%fs new=%fs). New stamp should be always greater than previous stamp. This new data is ignored. This message will appear only once.",
NODELET_WARN("Odometry: Detected not valid consecutive stamps (previous=%fs new=%fs). "
"New stamp should be always greater than previous stamp. This new data is ignored.",
previousStamp_, header.stamp.toSec());
return;
}
Expand Down
2 changes: 2 additions & 0 deletions src/nodelets/icp_odometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ class ICPOdometry : public rtabmap_ros::OdometryROS

void callbackCloud(const sensor_msgs::PointCloud2ConstPtr& pointCloudMsg)
{
UASSERT(pointCloudMsg->data.size() == pointCloudMsg->row_step*pointCloudMsg->height);

if(scanReceived_)
{
ROS_ERROR("%s is already receiving scans on \"%s\", but also "
Expand Down
2 changes: 2 additions & 0 deletions src/nodelets/rgbdicp_odometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ class RGBDICPOdometry : public rtabmap_ros::OdometryROS
}
else if(cloudMsg.get() != 0)
{
UASSERT(cloudMsg->data.size() == cloudMsg->row_step*cloudMsg->height);

bool containNormals = false;
if(scanVoxelSize_ == 0.0f)
{
Expand Down

0 comments on commit b9c7efd

Please sign in to comment.