Problems with launch and mapping
Posted by
denzle on
URL: http://official-rtab-map-forum.206.s1.nabble.com/Problems-with-launch-and-mapping-tp6808.html
Hi,
I've finally managed to setup a working (for the most part) launch file. I'm still getting a few errors but can at least see the point cloud the lidar is putting out but i'm unable to actually create a map. Could you tell me where i'm going wrong. Also if i try to set the frame_id to anything other than os1_(sensor/lidar/imu) everything goes to pot. I'm assuming i should be working with map -> odom -> base_link -> os1_sensor / base_link -> camera. But as soon as i try static transforms i get other errors whereby the lidar can't be found. So i've attached all the details for the one that does work-ish.
(Regarding the camera topics - I am awaiting a realsense D415 to arrive)
Many thanks in advance
Dan
Launch file:
<?xml version="1.0"?>
<!--
Copyright (c) 2018, STEREOLABS.
All rights reserved.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<launch>
<!-- node pkg="tf" type="static_transform_publisher" name="map_2_odom" args="0 0 0 0 0 0 /map /odom 100"/>
<node pkg="tf" type="static_transform_publisher" name="odom_2_base_link" args="0 0 0 0 0 0 /odom /base_link 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_2_os1_sensor" args="0 0 0 0 0 0 /base_link /os1_sensor 100"/>
<node pkg="tf" type="static_transform_publisher" name="base_link_2_camera" args="0 0 0 0 0 0 /base_link /camera 100"/ -->
<arg name="frame_id" default="os1_sensor"/>
<arg name="odom_frame_id" default="/odom"/>
<arg name="rtabmapviz" default="true" />
<arg name="rviz" default="true" />
<arg name="image" default="true" />
<arg name="scan_20_hz" default="false"/> <!-- If we launch the velodyne with "rpm:=1200" argument -->
<arg name="rgb_topic" default="/camera/color/image_raw"/>
<arg name="depth_topic" default="/camera/aligned_depth_to_color/image_raw"/>
<arg name="camera_info_topic" default="/camera/color/camera_info"/>
<node if="$(arg rviz)" pkg="ouster_ros" name="viz_node" type="viz_node" output="screen" required="true">
<remap from="~/os1_config" to="/os1_node/os1_config"/>
<remap from="~/points" to="/os1_cloud_node/points"/>
</node>
<node if="$(arg image)" pkg="ouster_ros" name="img_node" type="img_node" output="screen" required="true">
<remap from="~/os1_config" to="/os1_node/os1_config"/>
<remap from="~/points" to="/os1_cloud_node/points"/>
</node>
<group ns="rtabmap">
<node pkg="nodelet" type="nodelet" name="rgbd_sync" args="standalone rtabmap_ros/rgbd_sync" output="screen">
<remap from="rgb/image" to="$(arg rgb_topic)"/>
<remap from="depth/image" to="$(arg depth_topic)"/>
<remap from="rgb/camera_info" to="$(arg camera_info_topic)"/>
<remap from="rgbd_image" to="rgbd_image"/> <!-- output -->
<param name="approx_sync" type="bool" value="false"/> <!-- false for realsense -->
</node>
<node pkg="rtabmap_ros" type="icp_odometry" name="icp_odometry" output="screen">
<remap from="scan_cloud" to="/os1_cloud_node/points"/>
<param name="frame_id" type="string" value="$(arg frame_id)"/>
<remap from="imu" to="/os1_cloud_node/imu/data"/>
<param name="guess_frame_id" type="string" value="$(arg frame_id)"/>
<param name="wait_imu_to_init" type="bool" value="false"/>
<param name="Reg/Strategy" type="string" value="1"/>
<!-- ICP parameters -->
<param name="Icp/PointToPlane" type="string" value="false"/>
<param name="Icp/Iterations" type="string" value="10"/>
<param name="Icp/VoxelSize" type="string" value="0.2"/>
<param name="Icp/DownsamplingStep" type="string" value="1"/> <!-- cannot be increased with ring-like lidar -->
<param name="Icp/Epsilon" type="string" value="0.001"/>
<param name="Icp/PointToPlaneK" type="string" value="20"/>
<param name="Icp/PointToPlaneRadius" type="string" value="0"/>
<param name="Icp/MaxTranslation" type="string" value="2"/>
<param name="Icp/MaxCorrespondenceDistance" type="string" value="1"/>
<param name="Icp/PM" type="string" value="true"/>
<param name="Icp/PMOutlierRatio" type="string" value="0.7"/>
<param name="Icp/CorrespondenceRatio" type="string" value="0.01"/>
<!-- Odom parameters -->
<param name="Odom/ScanKeyFrameThr" type="string" value="0.9"/>
<param name="Odom/Strategy" type="string" value="1"/>
<param name="OdomF2M/ScanSubtractRadius" type="string" value="0.2"/>
<param name="OdomF2M/ScanMaxSize" type="string" value="15000"/>
</node>
<node pkg="rtabmap_ros" type="rtabmap" name="rtabmap" output="screen" args="-d">
<param name="subscribe_rgbd" type="bool" value="true"/>
<param name="frame_id" type="string" value="$(arg frame_id)"/>
<param name="subscribe_depth" type="bool" value="false"/>
<param name="subscribe_rgb" type="bool" value="false"/>
<param name="subscribe_scan_cloud" type="bool" value="true"/>
<param name="approx_sync" type="bool" value="false"/>
<param name="queue_size" type="int" value="10"/>
<param name="scan_cloud_max_points" value="32768"/> <!-- based on os-1 spec: 327,680 pts/second for 10 Hz -->
<remap from="odom" to="/odom"/>
<remap from="scan_cloud" to="/os1_cloud_node/points"/>
<remap from="rgbd_image" to="rgbd_image"/>
<!-- RTAB-Map's parameters -->
<param name="RGBD/NeighborLinkRefining" type="string" value="true"/>
<param name="RGBD/ProximityBySpace" type="string" value="true"/>
<param name="RGBD/AngularUpdate" type="string" value="0.01"/>
<param name="RGBD/LinearUpdate" type="string" value="0.01"/>
<param name="RGBD/OptimizeFromGraphEnd" type="string" value="false"/>
<param name="Reg/Strategy" type="string" value="1"/> <!-- 1=ICP -->
<param name="Reg/Force3DoF" type="string" value="false"/>
<param name="Vis/MinInliers" type="string" value="15"/>
<param name="Rtabmap/TimeThr" type="string" value="0"/> <!-- set to 0 to disable memory management -->
<param name="Mem/RehearsalSimilarity" type="string" value="0.45"/>
<param name="Grid/CellSize" type="string" value="0.05"/> <!-- 5cm voxel default-->
<param name="Kp/MaxFeatures" type="string" value="400"/>
<param name="Optimizer/Strategy" type="string" value="0"/> <!-- 0 is TORO, Default G20-->
<param name="RGBD/OptimizeMaxError" type="string" value="0"/> <!--When using TORO, seto to 0,otherwise set to 1-->
<param name="Kp/DetectorStrategy" type="string" value="6"/> <!--0=SURF 1=SIFT 2=ORB 3=FAST/FREAK 4=FAST/BRIEF 5=GFTT/FREAK 6=GFTT/BRIEF(default) 7=BRISK 8=GFTT/ORB 9=KAZE-->
<param name="Grid/FromDepth" type="string" value="true"/> <!--suppress warning (subscribe_scan=true)-->
<param name="RGBD/ProximityPathMaxNeighbors" type="string" value="1"/> <!--suppress warning (subscribe_scan = true and Reg/Strategy=1-->
<param name="Vis/FeatureType" type="string" value="6"/> <!--suppress warning,want to be same as KP/detectorstrategy -->
<!-- param name="Mem/LaserScanVoxelSize" type="string" value="0.1"/ -->
<!-- param name="Mem/LaserScanNormalK" type="string" value="10"/ -->
<!-- param name="Mem/LaserScanRadius" type="string" value="0"/ -->
<param name="Reg/Strategy" type="string" value="1"/>
<param name="Grid/CellSize" type="string" value="0.1"/>
<param name="Grid/RangeMax" type="string" value="20"/>
<param name="Grid/ClusterRadius" type="string" value="1"/>
<param name="Grid/GroundIsObstacle" type="string" value="true"/>
<param name="Grid/FromDepth" type="string" value="true"/>
<!-- ICP parameters -->
<param name="Icp/VoxelSize" type="string" value="0.2"/>
<param name="Icp/PointToPlaneK" type="string" value="20"/>
<param name="Icp/PointToPlaneRadius" type="string" value="0"/>
<param name="Icp/PointToPlane" type="string" value="false"/>
<param name="Icp/Iterations" type="string" value="10"/>
<param name="Icp/Epsilon" type="string" value="0.001"/>
<param name="Icp/MaxTranslation" type="string" value="3"/>
<param name="Icp/MaxCorrespondenceDistance" type="string" value="1"/>
<param name="Icp/PM" type="string" value="true"/>
<param name="Icp/PMOutlierRatio" type="string" value="0.7"/>
<param name="Icp/CorrespondenceRatio" type="string" value="0.4"/>
</node>
<node pkg="nodelet" type="nodelet" name="point_cloud_assembler" args="standalone rtabmap_ros/point_cloud_assembler" output="screen">
<param if="$(arg scan_20_hz)" name="max_clouds" type="int" value="20" />
<param unless="$(arg scan_20_hz)" name="max_clouds" type="int" value="10" />
<param name="fixed_frame_id" type="string" value="fusion" />
<remap from="cloud" to="/os1_cloud_node/points"/>
<remap from="odom" to="/odom"/>
</node>
<node if="$(arg rtabmapviz)" name="rtabmapviz" pkg="rtabmap_ros" type="rtabmapviz" output="screen">
<param name="frame_id" type="string" value="$(arg frame_id)"/>
<param name="odom_frame_id" type="string" value="/odom"/>
<param name="subscribe_odom_info" type="bool" value="true"/>
<param name="subscribe_scan_cloud" type="bool" value="true"/>
<param name="approx_sync" type="bool" value="false"/>
<remap from="scan_cloud" to="/os1_cloud_node/points"/>
<remap from="odom" to="/odom"/>
<param name="subscribe_depth" value="false"/><nabble_img src="Screenshot_from_2020-07-30_22-02-43.png" border="0" style="display: block; margin-left:auto; margin-right:auto;" alt="Rviz"/><nabble_img src="Screenshot_from_2020-07-30_22-05-11.png" border="0" style="display: block; margin-left:auto; margin-right:auto;" alt="TF "/><nabble_img src="rosgraphimg.png" border="0" style="display: block; margin-left:auto; margin-right:auto;" alt="ROSGraph"/>
</node>
</group>
</launch>



