# Driving your own Kalman Filter

The $DVKFA and $DVKFB messages can be used to drive your own Kalman filter. Here's a brief list of what you need to do.

1. Decide if you are going to use the DVL's IMU or your own IMU, or a combination. You could use the DVL's roll and pitch and you own heading reference, for example.
2. The velocities are give as along-track velocities on the sensor cone axis. You need to use your knowledge of how you mounted the sensor head and what you are pointing at to get the angle the sensor cone makes with the reflecting surface. For example, if the sensor head is mounted on your vehicle pointing straight down with the X-axis forward, and the vehicle is pitched down 5 degrees, and you are assuming the seabed is flat, then the along-track velocity V-A is is the +X sensor reported velocity V-R divided by sine\[ down-angle + 5 degrees ] (converesly, the along-track velocity V-B is the -X sensor reported velocity divided by sine\[down-angle - 5 degrees]). You will use different transforms if the sensor head is, for example, pointed sideways at a vertical surface.
3. You can use the locked and confidence values and your own transfer function to set the covariance of the velocity for each channel.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ceruleansonar.com/c/dvl-75/communicating-with-the-dvl/outgoing-message-formats-dvl-to-host/usddvkfa-usddvkfb-kalman-filter-support-messages/driving-your-own-kalman-filter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
