# robot_localization: How to state start position (x,y,z,r,p,y) for ekf

Im using UUV_simulator combined with your robot_localization package. I have been successfully been able to implement ekf with DVL, IMU and Pressure Sensor. The odometry estimate all start at (x,y,z,r,p,y) = (0,0,0,0,0,0), but I would like to start the node at my launch position in Gazebo simulator. How can I do this? I want my robot to launch at position (15,-20,0, 0,0,0) so that the ekf estimate proper pose interms of gazebo world frame.

Can I state the initial coordinates of my vehicle to the EKF somehow? mabye in the launch file?

edit retag close merge delete

Sort by » oldest newest most voted

According to the docs, this is what the initial_state parameter is for.

Note that this will start the respective filter, i.e. ekf_localization_node or ukf_localization_node (*) there, and not your odometry. This will still start at all zeros, as is expected for an odometric sensor.

Also note that the the estimate will deviate more and more from the actual position, as it is just incorporating odometric information and can thus not correct for errors there.

(*) I'm assuming you're using one of those two nodes, due to your title, description and the tags you used. If this is not the case, please state clearly which node you are using.

more

Yea, that worked, thank you! Just added the initial_state to the ekf_template.yaml file. I found out you could also do the same by using the setPose rosservice function.

more