Simulating robot_localization on pioneer3at with xsens 300 AHRS
I am testing robot_localization
using the receive_xsens
stack listed here: link text, and the ros-pioneer3at
stack listed here: link text.
I set up the frame id's to match those in the pioneer3at simulation stack as follows:
map_frame = Pioneer3AT/map
odom_frame = Pioneer3AT/odom
base_link_frame = Pioneer3AT/base_link
world_frame = Pioneer3AT/odom
I configured xsens imu to produce orientation, angular velocity, and acceleration. The imu0
configuration looks like this:
<param name="imu0" value="/imu/data" />
I will incorporate p3at hardware later with wheel encoders. For now trying to fuse simulated odometry from the ros-pioneer3at
stack. Specifically, I have configured the odom0
as follows:
<param name="odom0" value="Pioneer3AT/pose" />
After configuring, I launch the ros-pioneer3at
simulation, then launch the receive_xsens
hardware, then launch the ekf_localization
to fuse the sensor and simulation data.
There is no data being published to odometry/filtered
. I am not sure where to start the debugging.
-----edit 1-----
Here is the node graph:
-----edit 2-----
Thanks for the insight!
Here is the script for /Pioneer3AT/pose:
import rospy
import tf
from nav_msgs.msg import Odometry
def subCB(msg):
P = (msg.pose.pose.position.x, msg.pose.pose.position.y, msg.pose.pose.position.z )
Q = (msg.pose.pose.orientation.x, msg.pose.pose.orientation.y, msg.pose.pose.orientation.z, msg.pose.pose.orientation.w)
br = tf.TransformBroadcaster()
br.sendTransform(P, Q, rospy.Time.now(), "/Pioneer3AT/base_link", "world")
if __name__ == '__main__':
rospy.init_node('tf_from_pose')
rospy.Subscriber("/Pioneer3AT/pose", Odometry, subCB)
rospy.spin()
Also, here is the ekf_localization_node
launch file I used to try and fuse the xsens imu hardware with the ros-pioneer3at
simulation:
<launch>
<node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true">
<param name="frequency" value="30"/>
<param name="sensor_timeout" value="0.1"/>
<param name="two_d_mode" value="false"/>
<param name="map_frame" value="/Pioneer3AT/map"/>
<param name="odom_frame" value="/Pioneer3AT/odom"/>
<param name="base_link_frame" value="/Pioneer3AT/base_link"/>
<param name="world_frame" value="/Pioneer3AT/odom"/>
<param name="odom0" value="/Pioneer3AT/pose"/>
<param name="imu0" value="/imu/data"/>
<rosparam param="odom0_config">[true, true, true,
true, true, true,
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="odom0_pose_rejection_threshold" value="5"/>
<param name="imu0_pose_rejection_threshold" value="0.3"/>
<param name="imu0_angular_velocity_rejection_threshold" value="0.1"/>
<param name="imu0_linear_acceleration_rejection_threshold" value="0.1"/> -->
<rosparam param="process_noise_covariance">
[0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.05, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.06, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0 ...
your topics might be namespaced to "pioneer3AT/imu/data" for example. can you post a picture of the ros node graph from rqt?
Seems like you only have one input source (imu). I may be wrong, but im pretty sure you may need at least two. (wheel odometry, GPS, etc..)
@Tom Moore:
--
Pioneer3AT/pose
is of the typenav_msgs.msg/Odometry
. I have included the scripts in my original post, along with myekf_localization_node
, and a sample message from each sensor.--Still trying to get one sensor at a time up and running.
--Not able to run /imu/data alone.
Would you mind just posting one example of each sensor message? You don't need to do record all of them with -p. Just do rostopic echo, copy a single message, and paste it in the question. I'm not trying to debug all your data. I just want to see one sample message of each. Thanks!
Ha, no, sorry, I meant the entire message, complete with frame_ids. Like this (click the "more" link in the question to see the whole thing).
What do you mean by "set position/orientation with two broadcasters"? Do you still have the P3 node broadcasting the odom->base_link transform as well?
I meant that
ekf_localization
is broadcasting odom->base_link andGazebo_Bridge
is broadcasting odom->base_link. I could not realize another way to provide odom data in my current setup. For now, I am fusing simulation odom data, with xsens data. Later planned to use wheel odometry data.What do you mean by "provide odom data"? You simply can not have two different nodes publishing the same transform. If you are running
ekf_localization_node
, it is providing your odometry message and the odom->base_link transform.