how do i add barometer and gps data to robot localization?
im trying to build out the odometry for a drone and so far i got the imu fed in. but i can't figure out how to feed in the barometer(Altitude) and gps or the format they should be in. i tried reading thru the robot localization documentation but i just couldn't make sense of it. down below is the launch file im working with.
<launch>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true">
<param name="frequency" value="10"/>
<param name="sensor_timeout" value="0.2"/>
<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="drone_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, true,
true, true, false,
false, false, true,
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="true"/>
<param name="imu0_differential" value="true"/>
<param name="imu0_remove_gravitational_acceleration" value="false"/>
<rosparam param="process_noise_covariance">[LARGE ARRAY with small values]</rosparam>
<rosparam param="initial_estimate_covariance">[LARGE ARRAY with 1e-9]</rosparam>
</node>
</launch>
What could you not make sense of? What make barometer different than imu data?
my imu sensor has an accelerometer, gyro, and compass, with that i got the acceleration, angular velocity and orientation. the barometer will only give me altitude
What is the topic type? Odom/pose/imu or some custom data type from the barometer?
at the moment i just have the raw barometer data converted to meters. i don't know the exact topic type i should publish it as to feed it into the localization node
Publish your barometer message as one of these types and integrating it should be natural, just like you did your imu or odom.
thats where im stuck at i don't quite follow how the barometer should be publish and what should the param for it be? i can't find any explanation or example of integrating altitude.
Not knowing how to publish a message with the correct type is more fundamental than robot_localization. Check out c++ pub/sub or the equivalent tutorials in python.
it's not that, i don't now the format the altitude should be publish as. for example, for my imu i used sensor_msg.msg imu to setup the msg and published the imu.
this is where i setup the msg from my imu sensor then i published the msg
so just want to figure out how to do that for the altitude do i use sensor_msgs nav_msgs i just don't know. and then what should the params in my launnch file be?
Ah ok, because barometer describes a position basically, I would publish it as a pose with covariance
ok so geometry_msgs PoseWithCovarianceStamped is what i should us for the altitude. then what should the config for my launch file be do i do an odomx_config and would i do the same for my gps?
and im still a noob do you know any examples or tutorials for using geometry_msgs?
See someone working with that message type in python here. And consider that it is a pose message, do you think you will use odomX_config, or poseX_config?
ok so would want to use the posex_config and i would feed my gps into the x and y and the altitude into the z? thus my posex_config should look something like this:
Handle GPS data differently from barometer data unless there is an explicit reason to do so. See http://docs.ros.org/jade/api/robot_lo... and https://github.com/cra-ros-pkg/robot_.... I can't explain it better than those sources do
ok then for just the barometer i would only need to feed in the Z for the posex_config?