Re: ros-noetic usage

Posted by xantho on
URL: http://official-rtab-map-forum.206.s1.nabble.com/ros-noetic-usage-tp9609p9642.html

Thanks for your reply. This is definitely a start.

So, I am using this launch file:

<launch>

<!-- This launch assumes that you have already
   started you preferred RGB-D sensor and your IMU.
   TF between frame_id and the sensors should already be set too. -->

<arg name="rviz"                    default="true" />
<arg name="frame_id"                default="base_link"/>
<arg name="vis_odom_topic"          default="/rtabmap/odom"/>
<arg name="imu_topic"               default="/imu/data" />
<arg name="imu_remove_gravitational_acceleration" default="false" />
<arg name="localization"            default="false"/>

<include file="$(find rtabmap_launch)/launch/rtabmap.launch">
    <arg unless="$(arg localization)" name="rtabmap_args" value="--delete_db_on_start"/>
    <arg name="frame_id" value="$(arg frame_id)"/>
    <arg name="stereo"         value="true"/>
    <arg name="subscribe_rgbd" value="false"/>
    <arg name="subscribe_scan" value="false"/>

    <!-- stereo related topics -->
    <arg name="left_image_topic"        default="/camera/infra1/image_rect_raw" />
    <arg name="right_image_topic"       default="/camera/infra2/image_rect_raw" />      <!-- using grayscale image for efficiency -->
    <arg name="left_camera_info_topic"  default="/camera/infra1/camera_info" />
    <arg name="right_camera_info_topic" default="/camera/infra2/camera_info" />
    
    <arg name="rgbd_topic"  value="/rgbd_image"/> 

    <arg name="visual_odometry" value="true"/>
    <arg name="queue_size"  value="30"/>
    <arg name="compressed"  value="true"/>
    <arg name="rviz"        value="$(arg rviz)"/>
    <arg if="$(arg rviz)" name="rtabmap_viz"  value="false"/>  
    
    <arg name="approx_sync" value="false"/> <!-- cannot use exact sync with external odom -->
    <arg name="publish_tf_odom" value="false"/> <!-- to avoid conflicts with robot_localization odom tf -->
    <!-- <arg name="subscribe_odom_info" value="false"/> external odom used -->

</include>

<!-- Odometry fusion (EKF), refer to demo launch file in robot_localization for more info -->
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true" output="screen">

    <param name="frequency" value="50"/>
    <param name="sensor_timeout" value="0.1"/>
    <param name="two_d_mode" value="true"/>

    <param name="odom_frame" value="odom"/>
    <param name="base_link_frame" value="$(arg frame_id)"/>
    <param name="world_frame" value="odom"/>

    <param name="transform_time_offset" value="0.0"/>
    
    <param name="odom0"  value="$(arg vis_odom_topic)"/>
    <param name="imu0" value="$(arg imu_topic)"/>

    <!-- The order of the values is x, y, z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. -->
    <rosparam param="odom0_config">[true, true, false,
                                    false, false, false,
                                    true, true, false,
                                    false, false, false,
                                    false, false, false]</rosparam>
    
    <rosparam param="imu0_config">[false, false, false,
                                    false,  false,  true,
                                    false, false, false,
                                    false,  false,  true,
                                    false,  false,  false]</rosparam>

    <param name="odom0_differential" value="false"/>
    <param name="imu0_differential" value="false"/>

    <param name="odom0_relative"  value="true"/>
    <param name="imu0_relative" value="true"/>

    <param name="odom0_queue_size" value="5"/>
    <param name="imu0_queue_size" value="50"/>

    <!-- The values are ordered as x, y, z, roll, pitch, yaw, vx, vy, vz,
       vroll, vpitch, vyaw, ax, ay, az. -->
    <rosparam param="process_noise_covariance">[0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                                              0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]</rosparam>

    <!-- The values are ordered as x, y,
    z, roll, pitch, yaw, vx, vy, vz, vroll, vpitch, vyaw, ax, ay, az. -->
    <rosparam param="initial_estimate_covariance">[1e-9, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
                                                    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
                                                    0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
                                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
                                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
                                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
                                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
                                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
                                                    0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]</rosparam>

</node>
</launch>

for the rtabmap.launch I am remapping as follows:
<arg name="r_l_odom"                 default="/odometry/filtered"/>
<remap from="odom"                   to="$(arg r_l_odom)"/>
But rtabmap does not provide me with a map and I get the following:

[ INFO] [1692625446.142334056]: Odom: quality=448, std dev=0.003291m|0.011465rad, update time=0.061720s
[ INFO] [1692625446.225222154]: Odom: quality=454, std dev=0.003636m|0.011465rad, update time=0.073603s
[ INFO] [1692625446.300038160]: Odom: quality=444, std dev=0.003038m|0.008712rad, update time=0.071599s
[ WARN] [1692625446.319219789]: /rtabmap/rtabmap: Did not receive data since 5 seconds! Make sure the input topics are published ("$ rostopic hz my_topic") and the timestamps in their header are set. If topics are coming from different computers, make sure the clocks of the computers are synchronized ("ntpdate"). Parameter "approx_sync" is false, which means that input topics should have all the exact timestamp for the callback to be called.
/rtabmap/rtabmap subscribed to (exact sync):
   /odometry/filtered \
   /camera/infra1/image_rect_raw_relay \
   /camera/infra2/image_rect_raw_relay \
   /camera/infra1/camera_info \
   /camera/infra2/camera_info \
   /rtabmap/odom_info
[ INFO] [1692625446.393891883]: Odom: quality=456, std dev=0.003119m|0.000173rad, update time=0.071331s
[ INFO] [1692625446.488615394]: Odom: quality=429, std dev=0.003235m|0.010360rad, update time=0.069431s
[ INFO] [1692625446.591836136]: Odom: quality=433, std dev=0.003581m|0.021486rad, update time=0.067578s
[ INFO] [1692625446.695476868]: Odom: quality=440, std dev=0.002802m|0.000173rad, update time=0.069887s
[ INFO] [1692625446.784578256]: Odom: quality=437, std dev=0.003176m|0.014651rad, update time=0.062510s
[ INFO] [1692625446.877034063]: Odom: quality=433, std dev=0.002919m|0.012320rad, update time=0.062300s
[ WARN] [1692625446.905675660]: Transform from imu_link to base_link was unavailable for the time requested. Using latest instead.
 
The camera topics are coming from my ugv and the rtabmap runs on my laptop. The 2 pc's are synchronized using ntpdate.
I also have a nodelet manager (running on the laptop):

NODES
  /
    nodelet_manager (nodelet/nodelet)
    stereo_sync (nodelet/nodelet)

ROS_MASTER_URI=http://localhost:11311/

process[nodelet_manager-1]: started with pid [1015491]
process[stereo_sync-2]: started with pid [1015492]
[ INFO] [1692617864.523122902]: Loading nodelet /stereo_sync of type rtabmap_sync/stereo_sync to manager nodelet_manager with the following remappings:
[ INFO] [1692617864.523657748]: /left/camera_info -> /camera/infra1/camera_info
[ INFO] [1692617864.523703523]: /left/image_rect -> /camera/infra1/image_rect_raw
[ INFO] [1692617864.523717080]: /rgbd_image -> /rgbd_image
[ INFO] [1692617864.523728656]: /right/camera_info -> /camera/infra2/camera_info
[ INFO] [1692617864.523739181]: /right/image_rect -> /camera/infra2/image_rect_raw
[ INFO] [1692617864.524612772]: waitForService: Service [/nodelet_manager/load_nodelet] has not been advertised, waiting...
[ INFO] [1692617864.566102953]: waitForService: Service [/nodelet_manager/load_nodelet] is now available.

Appreciate your input.