Integrate a GPS sensor with robot_localization and use move_base node
Hello,
I’m trying to integrate a GPS
sensor to my mobile robot with the robot_localization_node
. I have an IMU sensor added to my robot_localization_node
but now I have some theoretical questions about how to integrate the GPS
.
I would like to use the output of the robot_localization node
to feed the move_base node
in order to set some waypoints in GPS coordinates (can be in UTM) and then the robot follow them.
I’m a bit lost about how to proceed. This is what I think:
I launch ek_localization_node
with this inputs: IMU
and wheel_odom
. And I remap the output topic to local_odometry
. It'll be the local odometry in odom frame. (I must use this topic to input to move_base
if I want to navigate in odom
frame).
Then I launch navsat_transform_node
with IMU
, wheel_odom
, and GPS NavSatFix
and the output topic in world frame is /odometry/gps
. But this topic is publishing only when the GPS signal is received so...
I launch another ekf_localization node
with IMU
,Wheel_odom
and odom1
(/odometry/gps
from navsat_transform node
). The output of this node (/odometry/filtered
) is in world frame and is what I have to put as input to move_base
, right?
With this configuration I don’t need to use gps_common
, right?
When I launch all, I have to call the service set_pose
in order to give some estimation pose in UTM coordinates to /odom in base to /world, isn’t?
UPDATE 1:
Thanks Tom. I've taken into account all your comments and here's my robot_localization
launch file and my tf tree.
I feed the
move_base
odometry with thelocal_odometry
returned by my first instance ofekf_localization_node
.As I've my waypoints in UTM coordinates, their should be in
utm frame
. I can't see the tf of utm frame publishing, but in the source code I see it's/utm
.I think the
global planner
ofmove_base_node
needs the global frame set to the same frame of the waypoints. So It should be/utm
, but when I launch this configuration,move_base_node
says this:
[ WARN] [1422876635.213009322]: Waiting on transform from summit_a/base_footprint to utm to become available before running costmap, tf error:
I understand that move_base
can't find the tf between utm
and base_footprint
frames. I don't know if it can be because the tf isn't visible by move_base_node
or I'm doing something wrong.
- (Just to test.) If I set the global frame of the
global_panner
ofmove_base_node
tosummit_a/world
it reports me this:
[ERROR] [1422873579.326459610]: The goal pose passed to this planner must be in the summit_a/world frame. It is instead in the summit_a/utm frame.
- (other test) Setting the global frame of
global_planner
tosummit_a/odom
:
[ERROR] [1422876188.622192440]: The goal pose passed to this planner must be in the summit_a/odom frame. It is instead in the utm frame.
So, the global_planner
frame of move_base_node
needs to be consistent or the same that the frame of the ...
Thanks for the update. I'll look into this and get back to you.
Yeah, I can't make the utm frame the parent of odom, as that would conflict with any other nodes (like
amcl
) that need to publish a map->odom transform. I need to look at move_base, but in general, if you usetf
's transform methods, parentage shouldn't matter.In response to EDIT 1. Yes, it's still true. My IMU only offers me angular velocity and linear acceleration. Maybe can I use the orientation that the GPS gives me?
Is it possible do visible the tf odom->utm? Thanks.
Sure, as long as it's being broadcast. Just do this:
Also, yes, you can use the GPS heading, but you'd have to have some logic in there to (a) make sure the heading isn't bogus, because it will be until you move, and (b), send out an IMU message with that heading in it (might want to include the roll and pitch from your actual IMU as well).