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

how do i connect mavros to move_base? how to correct disconnected tf trees?

asked 2023-01-05 19:12:40 -0500

monkeydrone gravatar image

updated 2023-01-06 13:20:52 -0500

I am trying to recreate this project but with a real drone. I'm using a orange cube flight controller (mavros), oak-d stereo camera, and A1RpLidar. on noetic ubuntu 20.04

I have had all the elements working separately. Right now i have 2 problems. but im sure there are more.

Here i have no idea what im doing as a whole picture.

[ WARN] [1672964833.982613712]: odometry: Could not get transform from base_link to oak_right_camera_optical_frame (stamp=1672964833.653390) after 0.200000 seconds ("wait_for_transform_duration"=0.200000)! Error="Could not find a connection between 'base_link' and 'oak_right_camera_optical_frame' because they are not part of the same tree.Tf has two or more unconnected trees.. canTransform returned after 0.200662 timeout was 0.2."

I have had this part working independently of this launch file so i dont know why this isnt working.

[ WARN] [1672964834.084149753]: /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"). If topics are not published at the same rate, you could increase "queue_size" parameter (current=10).
/rtabmap/rtabmap subscribed to (approx sync):
   /rtabmap/odom \
   /stereo_inertial_publisher/right/image_rect \
   /stereo_inertial_publisher/stereo/depth \
   /stereo_inertial_publisher/right/camera_info \

Here is a copy of my launch file

<?xml version="1.0"?>

        <arg name="localization" default="false"/>
        <arg name="rtabmapviz"   default="true"/>
        <arg name="ground_truth" default="false"/>

        <arg     if="$(arg localization)" name="pre_args" default=""/>
        <arg unless="$(arg localization)" name="pre_args" default="-d"/>

        <node pkg="nodelet" type="nodelet" name="imu_to_tf" args="standalone rtabmap_ros/imu_to_tf">
          <remap from="imu/data" to="/mavros/imu/data"/>
          <param name="fixed_frame_id" value="base_link_stabilized"/>
          <param name="base_frame_id" value="base_link"/>

        <!-- To connect rtabmap planning stuff with move_base below -->
        <param name="/rtabmap/rtabmap/use_action_for_goal" value="true"/>
        <remap from="/rtabmap/move_base" to="/move_base"/>

        <!-- VSLAM -->
        <param name="/rtabmap/rtabmap/latch" value="false"/> <!-- For some reason, if we latch grid_map, the global costmap inflation layer will create holes on robot path. To avoid holes, republish grid_map on each update (latching disabled). -->
        <include file="$(find rtabmap_ros)/launch/rtabmap.launch">
          <arg name="localization"      value="$(arg localization)"/>
          <arg name="args"              value="$(arg pre_args) --Optimizer/GravitySigma 0.1 --Vis/FeatureType 10 --Kp/DetectorStrategy 10 --Grid/MapFrameProjection true --NormalsSegmentation false --Grid/MaxGroundHeight 1 --Grid/MaxObstacleHeight 1.6 --RGBD/StartAtOrigin true" />
          <arg name="rtabmapviz"        value="$(arg rtabmapviz)" /> 
          <arg name="frame_id"          value="base_link" />
          <arg name="odom_guess_frame_id" value="base_link_stabilized" />

          <arg name="rgb_topic"         value="/stereo_inertial_publisher/right/image_rect" />
          <arg name="depth_topic"       value="/stereo_inertial_publisher/stereo/depth" />
          <arg name="camera_info_topic" value="/stereo_inertial_publisher/right/camera_info" />

          <arg name="imu_topic"         value="/mavros/imu/data"/>
          <arg name="wait_imu_to_init"  value="true"/>
          <arg name="approx_sync"       value="true"/>
          <arg if="$(arg ground_truth)" name="ground_truth_frame_id" value="world"/>
          <arg if="$(arg ground_truth ...
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-01-06 15:20:29 -0500

Shivam gravatar image

updated 2023-01-06 15:21:11 -0500

To connect the mavros node to the move_base node in ROS, you will need to follow these steps:

  1. Make sure that the mavros node is correctly configured and running on your system. The mavros node is used to communicate with a MAVLink-based autopilot, such as the PX4 flight stack, and provides a bridge between the autopilot and ROS.

  2. Configure the move_base node to use the mavros node as the "base controller" for your robot. You can do this by setting the base_global_planner and base_local_planner parameters in the move_base configuration file to the names of the global and local planner plugins that you want to use. For example, if you want to use the teb_local_planner and the global_planner from the navfn package as the local and global planners, you would set the base_local_planner and base_global_planner parameters to teb_local_planner and global_planner, respectively.

  3. Make sure that the move_base node is correctly configured to receive and process the pose and velocity estimates from the mavros node. You can do this by setting the odom_topic parameter in the move_base configuration file to the name of the topic that the mavros node is publishing pose and velocity estimates to. The mavros node typically publishes this information to the /mavros/local_position/pose and /mavros/local_position/velocity_local topics.

To correct "disconnected neural trees" in your robot, you will need to identify the cause of the problem and apply an appropriate solution. Disconnected neural trees can occur for a variety of reasons, such as errors in the robot's perception or localization system, problems with the robot's hardware or software, or errors in the robot's planning or control algorithms. Without more context, it is difficult to provide specific advice on how to correct disconnected neural trees in your

edit flag offensive delete link more

Question Tools


Asked: 2023-01-05 19:12:40 -0500

Seen: 313 times

Last updated: Jan 06 '23