Ask Your Question

How to insert tf frames into HectorSLAM tf structure - using data from the Pixhawk 4 mini's IMU

asked 2020-02-06 06:14:56 -0500

SamH gravatar image

I am using HectorSLAM for a UAV application. I have setup HectorSLAM to work with just the base_link and laser frames as shown below. (Following these instructions: link text) This works for static mapping but obviously does not take into account the rotation and vertical position of the laser scanner. The question has 2 parts:

  1. How do I insert frames (such as the base_stabilized frame) into the tf frames tree
  2. How do setup this frame (for example between base_stabilized) to read data from an IMU. I am using the Pixhawk 4 mini flight controller, which uses QGroundControl to allow data from the PIxhawk to be read. Many Thank for your help.

    image description

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-02-06 12:51:45 -0500

I can answer Q1, Q2 is solely dependent on your application and I'm not going to go into application specifics.

How do I insert frames

I'm glad you asked! There's a great tutorial here ( that discusses it. The core bit is that in your node (or create a new node) you create a Transform message with the parent (root) and child (child) of the transformation tree frames with their relative current position and orientation. An example from your tree is that the base_link is the parent to laser, so something is publish that frame via code similar to this tutorial to TF. So if you want to add a base_stabilized from base_link, you just need to make a message via that tutorial publishing it with whatever pose information is appropriate.

edit flag offensive delete link more


Thank you again! I'll work my way through that. I have managed to subscribe to the messages being published by the IMU without using QGroundControl, so once I've added the new frame I'll get that frame listening to the IMU data.

SamH gravatar image SamH  ( 2020-02-07 06:25:54 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-02-06 06:14:56 -0500

Seen: 76 times

Last updated: Feb 06 '20