ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Setup frames lidar odometry, gps, IMU

asked 2023-02-07 10:20:50 -0500

Axl CRNL gravatar image

Hello dear community, I am trying to fuse localization data from rtabmap icp odometry (odom->base_footprint), rtabmap(map->base_footprint), gps odometry from navsat_tranform node and imu data out of madgwick filter.

<node pkg="nodelet" type="nodelet" name="imu_manager" args="manager" output="screen" />
<node pkg="nodelet" type="nodelet" name="ImuFilterNodelet" args="load imu_filter_madgwick/ImuFilterNodelet imu_manager" output="screen">
    <!-- in -->
    <remap from="/imu/data_raw" to="/zed_multi/zed2_rear/zed_nodelet_rear/imu/data"/>
    <remap from="/imu/mag" to="/zed_multi/zed2_rear/zed_nodelet_rear/imu/mag"/>
    <!-- out -->
    <remap from="/imu/data" to="$(arg imu_topic)"/>

    <param name="publish_debug_topics" value="true"/>
    <param name="publish_tf" value="false"/>
    <param name="world_frame" value="enu"/>
    <param name="use_magnetic_field_msg" value="false"/>
    <param name="use_mag" value="true"/>
    <param name="fixed_frame" value="odom"/>
</node>

<node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node">
    <param name="magnetic_declination_radians" value="0.083776"/> 
    <param name="yaw_offset" value="0"/><!--IMU heading face east-->
    <param name="zero_altitude" value="true"/>
    <param name="frequency" value="30"/>
    <param name="use_odometry_yaw" value="false"/>
    <param name="broadcast_cartesian_transform" value="true"/>
    <param name="publish_filtered_gps" value="true"/>

    <remap from="/odometry/filtered" to="/rtabmap/odom"/>
    <remap from="/gps/fix" to="$(arg gps_topic)" />
    <remap from="/imu/data" to="/imu/data/madgwicked" />
    <remap from="/odometry/gps" to="/odometry/navsat_gps" />
</node>

<node pkg="rtabmap_ros" type="rtabmap" name="rtabmap" output="screen" args="-d">      
        <param name="frame_id"        type="string" value="base_footprint"/>  
        <param name="odom_frame_id"   type="string" value="odom"/>
        <param name="map_frame_id"   type="string" value="map"/>
(...)
</node>
<node pkg="rtabmap_ros" type="icp_odometry" name="icp_odometry" output="screen">         
        <remap from="imu"        to="/imu/data/madgwicked"/>
        <param name="frame_id"        type="string" value="base_footprint"/>  
        <param name="odom_frame_id"   type="string" value="odom"/>
        <param name="map_frame_id"   type="string" value="map"/>
(...)
with wait_for_imu = true

However, I am unable to put the gps and the lidar odometry in the same frame. I end up having a rotation betwwend my gps point and my lidar odometry point. To summarize, I am unable to understand what I am doing wrong, either from specifying the wrong frames and therefore having a wrong tf tree, not specifying a yaw offset but then I do not know which physical value or if I have an issue with my hardware.

I get that I have to have an ENU referenced IMU (which is why I used the madgwick filter along with the magnetometer of the IMU). Then by initialising the robot pose using the IMU the orientation should be equal to 0 0 0 when facing east. However when my robot faces around east I have

Odometry.cpp:317::process() Updated initial pose from xyz=0.000000,0.000000,0.000000 rpy=0.000000,-0.000000,0.000000 to xyz=0.000000,0.000000,0.000000 rpy=0.002946,0.002428,-2.387123 with IMU orientation

in rtabmap (easier to read than a quaternion) which could mean that the IMU is not earth referenced. Then again : software, hardware ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-02-07 21:09:39 -0500

chased11 gravatar image

As I understand it, the odometry/filtered input in navsat_transform_node should be from the EKF odometry where it is being fused, not your raw odometry source. So try to take out

<remap from="/odometry/filtered" to="/rtabmap/odom"/>

I am not 100% sure that will fix it but give that a try.

edit flag offensive delete link more

Comments

Well my current set up for navsat_tranform node uses the IMU and not the odometry yaw. However I can try to set up a local and global kalmann filter as proposed here.

Axl CRNL gravatar image Axl CRNL  ( 2023-02-08 03:16:11 -0500 )edit

I had some weird behavior when I didn't use the feedback from the EKF the GPS data was fused into, can't say for sure for you. I think the problem that could arise is the odometry position estimate would be in it's own relative coordinate frame, rather than the absolute frame that the EKF output would be.

chased11 gravatar image chased11  ( 2023-02-08 11:31:52 -0500 )edit

Yeah that's the thing. Gps and lidar odometry are on ther own coordinate frame. Fusing the magnetometer and the imu in the madgwick filter should solve the orientation problem and starting both at 0,0 should do. But it does not which is why I wonder if I set up something wrong, or if it's a hardware problem.

Axl CRNL gravatar image Axl CRNL  ( 2023-02-09 03:38:07 -0500 )edit

When it's fused in the kalman filter they're all transformed to the base frame. Setting the odom source in the EKF to relative was my fix when I had this issue

chased11 gravatar image chased11  ( 2023-02-09 11:54:23 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-02-07 10:20:50 -0500

Seen: 207 times

Last updated: Feb 07 '23