I'm trying to setup a localization system for my aerial vehicle, however I never used robot_localization or the TF package, so everything seems a little overwhelming, setup wise. I have a couple of questions:
Is it possible to use robot_localization with only GPS and IMU? Would the output be any good?
I have a bottom camera that is used from ground target detection. Should I use it for some kind of visual odometry? I'm afraid that this will put the processor under too much strain (odroid X2).
Can I get some tips on how to setup all of this? I find myself a little lost.
EDIT1: Just for some context, my system is an aerial vehicle supported by a balloon that uses two rotors in order to adjust its position:
(1-baloon; 5-rotors; 4-bottom camera (webcam); 3-main "box" with GPS, IMU, odroid X2, etc)
I had already changed the IMU output to be as specified in REP-103. Initially I was using "udm_odometry_node" from gps_common, but switched to the "navsat_transforme_node". For the altitude I'm using the GPS, since the IMU I'm using doesn't have altitude information.
The bottom camera (simple webcam) is meant for ground target detection/tracking, however I could use it for some kind of visual odometry if the odroid is able to handle it.
I think I was able to setup everything correctly since I'm able to "echo" the output on odometry/filtered. However it seems like it has a lot of noise. I still have to do some real tests, since I only tested this with my laptop and the sensors were stationary. (Note: Are the velocities in Twist set as m/s?)
However I got an error when trying to set the process_noise_covariance (type 7 if I recall correctly). Since I was using the covariance from the template launch file, I just deleted it in order to check if everything was working (if I was able to get an output).
EDIT2: (For some reason I'm unable to comment your answer. Whenever I write a comment it disappears when I refresh the page)
One of the problems might be connected to the fact that all covariances on the IMU message are set to 0, since I wasn't able to find information about those parameters for the mpu9150. Besides that, the IMU might need some new calibration.
Sample of the IMU msg:
---
header:
seq: 14983
stamp:
secs: 1429104187
nsecs: 410562312
frame_id: imu
orientation:
x: 0.00824941202457
y: 0.0174910227596
z: 0.0350623021512
w: 0.997508466348
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
angular_velocity:
x: -0.0017719756579
y: 0.00648836186156
z: 0.000426339596743
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration:
x: -0.210282728076
y: 0.174357444048
z: 9.848320961
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
I'm going to do some outdoor's testing, to understand the performance of the gps+imu.
EDIT3:
After an outdoor test I found that something must be wrong with my setup. This is the plot from the odometry/gps. The path was a rectangle of around 100m for 40m. However, as you can see, although the output is close to that, the angles between parts of the path are not 90degrees.
And the plot from odometry/filtered is even worse. From what I can tell I think the IMU msg is being created as specified in REP-103. However the output is this:
FYI my launch file is:
<launch>
<node pkg="tf" type="static_transform_publisher" name="imu_tf" args="0 0 0 0 0 0 1 /base_link /imu 20"/>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true">
<param name="frequency" value="30"/>
<param name="sensor_timeout" value="1"/>
<param name="two_d_mode" value="true"/>
<param name="map_frame" value="map"/>
<param name="odom_frame" value="odom"/>
<param name="base_link_frame" value="base_link"/>
<param name="world_frame" value="odom"/>
<param name="odom0" value="odom"/>
<param name="imu0" value="/imu/data"/>
<rosparam param="odom0_config">[true, true, true,
false, false, false,
false, false, false,
false, false, false,
false, false, false]</rosparam>
<rosparam param="imu0_config">[false, false, false,
true , true , true,
false, false, false,
true , true , true,
true , true , true ]</rosparam>
<param name="odom0_differential" value="false"/>
<param name="imu0_differential" value="false"/>
<param name="imu0_remove_gravitational_acceleration" value="true"/>
<param name="print_diagnostics" value="false"/>
<!-- ======== ADVANCED PARAMETERS ======== -->
<param name="odom0_queue_size" value="2"/>
<param name="imu0_queue_size" value="10"/>
<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>
<node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node" respawn="true" output="screen">
<remap from="/gps/fix" to="/fix"/>
<param name="magnetic_declination_radians" value="-0.047124"/>
<param name="yaw_offset" value="0"/>
<param name="zero_altitude" value="false"/>
<param name="broadcast_utm_transform" value="false"/>
<param name="publish_filtered_gps" value="false"/>
</node>
</launch>
EDIT4: I will post a 2 bags with the test of the rectangular path of around 100m for 40m. The launch file used was the one posted above, but with 'two_d_mode' set to false: bagfiles
Originally posted by nvoltex on ROS Answers with karma: 131 on 2015-04-14
Post score: 1
Original comments
Comment by Tom Moore on 2015-05-01:
Thanks, I'll check out the bags when I get a chance.
Comment by Tom Moore on 2015-05-05:
Question: as this is a UAV, does the robot often fly in a direction other than the direction it's facing? In other words, is its course over ground different from its heading/yaw? Even though the direction of travel in your GPS data is west-to-east, the IMU reads about -0.99 radians.
Comment by Tom Moore on 2015-05-05:
Also, can you add a cheap barometer to this thing? You should really have an altitude estimate of some kind. I have a launch file that worked for me (with the latest source), and I will post it when you answer these questions.
Comment by nvoltex on 2015-05-06:
The bagfile is from a test I did with only the GPS and IMU. That is, it was not the UAV that performed the path. I performed the path with the laptop, GPS and IMU while mantaining the imu in a position similar to the one it would be in the system. Notice that this IMU has no magnometer information.
Comment by nvoltex on 2015-05-06:
The GPS altitude information is really bad, so I will have to add a barometer to the system. By the end of this month I might have a new IMU with barometer, which should be enough, right?
Another question, is there a way to get a better estimate of linear velocity? with the GPS alone it's too noisy
Comment by Tom Moore on 2015-05-06:
If you don't have a world-referenced yaw/heading estimate, navsat_transform_node
will not perform correctly. You need a magnetometer. You could always try pointing a camera downward and using optical flow + altitude to determine linear velocity.
Comment by nvoltex on 2015-05-07:
The IMU I'm using has a magnetometer, however I decided not to use it since it seemed to be sensible to electrical noise (from other hardware around the IMU). The use of the downward camera and optical flow was my first idea, however I'm not sure if it will be too demanding for the odroid.
Comment by Tom Moore on 2015-05-07:
Can you calibrate the IMU for hard and soft iron distortion? Also, if you downsampled the image data enough, you could probably get by with optical flow on an Odroid. I'm not sure how powerful the X2 is (I have a U3).
Comment by nvoltex on 2015-05-07:
I think I should be able to calibrate the IMU for hard and soft iron distortion.
I will try that ;) Thanks
Btw, which launch file did you use?
Comment by Tom Moore on 2015-05-10:
I put a simple one together myself. As your bag files lacked an absolute heading reference, it was really no better than the ones you had.