Kalman filter implementation for a driving simulation in a final project
$begingroup$
Currently I am designing a Kalman filter-based steering for my final paper in a driving simulator. I'm actually new to the Kalman filtering method but I've studied a couple of journals I can find, though I do have problems when designing my system. Apologies if there are mistakes in the following question since this is basically my first time into the system.
The proposed system has a purpose to predict the steering based on the target position.
From here, the state vector I'll be using is defined as
$$x = begin{bmatrix}
alpha \
v \
end{bmatrix}
$$
where $alpha$ is the steering angle and $v$ is the car's velocity. I'm also using the basic kinematics for the $F$ vector with
$$F = begin{bmatrix}
1 & Delta T \
0 & 1 \
end{bmatrix}
$$
where $Delta T$ will be the time step for the system. As for the measurement vector $z$, it'll comprise of
$$z = begin{bmatrix}
alpha_x \
alpha_y \
v_x \
v_y \
end{bmatrix}
$$
which are positions and current speeds in regards to x and y axes, all in Cartesian. The positions for x and y are defined as
$$
x = rho times cos theta
$$
$$
y = rho times sin theta
$$
Where $rho$ is the distance calculated based on the sensor readings and $theta$ is the angle.
Given the measurements, I would also have to map the $h(x)$ vector (making this an Extended Kalman Filter) so that it'll form the eventual steering and velocity estimates using the following mapping.
$$h(hat x) = begin{bmatrix}
arctan(frac {2y}{x}) \
frac {v}{3.6} \
end{bmatrix}
$$
With this, I have a couple of questions regarding to the difficulty I have:
1) According to the formula, the error $y$ is calculated by $z - h(hat x)$, but given the difference of the matrices, are both the $z$ and $hat x$ matrices being subtracted first before transformed into $h$ or not? I might perceive this the wrong way and this is one of the difficulties I have in understanding it.
2) How do I express $arctan(frac {2y}{x})$ in matrix form such that it could be along the lines of the following normal filter $H$ matrix?
$$H = begin{bmatrix}
1 & 1 & 0 & 0 \
0 & 0 & 1 & 0 \
end{bmatrix}
$$
Given that this would eventually form the Jacobian matrices for $F_j$ and $H_j$?
Thanks in advance!
kalman-filter
$endgroup$
add a comment |
$begingroup$
Currently I am designing a Kalman filter-based steering for my final paper in a driving simulator. I'm actually new to the Kalman filtering method but I've studied a couple of journals I can find, though I do have problems when designing my system. Apologies if there are mistakes in the following question since this is basically my first time into the system.
The proposed system has a purpose to predict the steering based on the target position.
From here, the state vector I'll be using is defined as
$$x = begin{bmatrix}
alpha \
v \
end{bmatrix}
$$
where $alpha$ is the steering angle and $v$ is the car's velocity. I'm also using the basic kinematics for the $F$ vector with
$$F = begin{bmatrix}
1 & Delta T \
0 & 1 \
end{bmatrix}
$$
where $Delta T$ will be the time step for the system. As for the measurement vector $z$, it'll comprise of
$$z = begin{bmatrix}
alpha_x \
alpha_y \
v_x \
v_y \
end{bmatrix}
$$
which are positions and current speeds in regards to x and y axes, all in Cartesian. The positions for x and y are defined as
$$
x = rho times cos theta
$$
$$
y = rho times sin theta
$$
Where $rho$ is the distance calculated based on the sensor readings and $theta$ is the angle.
Given the measurements, I would also have to map the $h(x)$ vector (making this an Extended Kalman Filter) so that it'll form the eventual steering and velocity estimates using the following mapping.
$$h(hat x) = begin{bmatrix}
arctan(frac {2y}{x}) \
frac {v}{3.6} \
end{bmatrix}
$$
With this, I have a couple of questions regarding to the difficulty I have:
1) According to the formula, the error $y$ is calculated by $z - h(hat x)$, but given the difference of the matrices, are both the $z$ and $hat x$ matrices being subtracted first before transformed into $h$ or not? I might perceive this the wrong way and this is one of the difficulties I have in understanding it.
2) How do I express $arctan(frac {2y}{x})$ in matrix form such that it could be along the lines of the following normal filter $H$ matrix?
$$H = begin{bmatrix}
1 & 1 & 0 & 0 \
0 & 0 & 1 & 0 \
end{bmatrix}
$$
Given that this would eventually form the Jacobian matrices for $F_j$ and $H_j$?
Thanks in advance!
kalman-filter
$endgroup$
add a comment |
$begingroup$
Currently I am designing a Kalman filter-based steering for my final paper in a driving simulator. I'm actually new to the Kalman filtering method but I've studied a couple of journals I can find, though I do have problems when designing my system. Apologies if there are mistakes in the following question since this is basically my first time into the system.
The proposed system has a purpose to predict the steering based on the target position.
From here, the state vector I'll be using is defined as
$$x = begin{bmatrix}
alpha \
v \
end{bmatrix}
$$
where $alpha$ is the steering angle and $v$ is the car's velocity. I'm also using the basic kinematics for the $F$ vector with
$$F = begin{bmatrix}
1 & Delta T \
0 & 1 \
end{bmatrix}
$$
where $Delta T$ will be the time step for the system. As for the measurement vector $z$, it'll comprise of
$$z = begin{bmatrix}
alpha_x \
alpha_y \
v_x \
v_y \
end{bmatrix}
$$
which are positions and current speeds in regards to x and y axes, all in Cartesian. The positions for x and y are defined as
$$
x = rho times cos theta
$$
$$
y = rho times sin theta
$$
Where $rho$ is the distance calculated based on the sensor readings and $theta$ is the angle.
Given the measurements, I would also have to map the $h(x)$ vector (making this an Extended Kalman Filter) so that it'll form the eventual steering and velocity estimates using the following mapping.
$$h(hat x) = begin{bmatrix}
arctan(frac {2y}{x}) \
frac {v}{3.6} \
end{bmatrix}
$$
With this, I have a couple of questions regarding to the difficulty I have:
1) According to the formula, the error $y$ is calculated by $z - h(hat x)$, but given the difference of the matrices, are both the $z$ and $hat x$ matrices being subtracted first before transformed into $h$ or not? I might perceive this the wrong way and this is one of the difficulties I have in understanding it.
2) How do I express $arctan(frac {2y}{x})$ in matrix form such that it could be along the lines of the following normal filter $H$ matrix?
$$H = begin{bmatrix}
1 & 1 & 0 & 0 \
0 & 0 & 1 & 0 \
end{bmatrix}
$$
Given that this would eventually form the Jacobian matrices for $F_j$ and $H_j$?
Thanks in advance!
kalman-filter
$endgroup$
Currently I am designing a Kalman filter-based steering for my final paper in a driving simulator. I'm actually new to the Kalman filtering method but I've studied a couple of journals I can find, though I do have problems when designing my system. Apologies if there are mistakes in the following question since this is basically my first time into the system.
The proposed system has a purpose to predict the steering based on the target position.
From here, the state vector I'll be using is defined as
$$x = begin{bmatrix}
alpha \
v \
end{bmatrix}
$$
where $alpha$ is the steering angle and $v$ is the car's velocity. I'm also using the basic kinematics for the $F$ vector with
$$F = begin{bmatrix}
1 & Delta T \
0 & 1 \
end{bmatrix}
$$
where $Delta T$ will be the time step for the system. As for the measurement vector $z$, it'll comprise of
$$z = begin{bmatrix}
alpha_x \
alpha_y \
v_x \
v_y \
end{bmatrix}
$$
which are positions and current speeds in regards to x and y axes, all in Cartesian. The positions for x and y are defined as
$$
x = rho times cos theta
$$
$$
y = rho times sin theta
$$
Where $rho$ is the distance calculated based on the sensor readings and $theta$ is the angle.
Given the measurements, I would also have to map the $h(x)$ vector (making this an Extended Kalman Filter) so that it'll form the eventual steering and velocity estimates using the following mapping.
$$h(hat x) = begin{bmatrix}
arctan(frac {2y}{x}) \
frac {v}{3.6} \
end{bmatrix}
$$
With this, I have a couple of questions regarding to the difficulty I have:
1) According to the formula, the error $y$ is calculated by $z - h(hat x)$, but given the difference of the matrices, are both the $z$ and $hat x$ matrices being subtracted first before transformed into $h$ or not? I might perceive this the wrong way and this is one of the difficulties I have in understanding it.
2) How do I express $arctan(frac {2y}{x})$ in matrix form such that it could be along the lines of the following normal filter $H$ matrix?
$$H = begin{bmatrix}
1 & 1 & 0 & 0 \
0 & 0 & 1 & 0 \
end{bmatrix}
$$
Given that this would eventually form the Jacobian matrices for $F_j$ and $H_j$?
Thanks in advance!
kalman-filter
kalman-filter
asked Dec 5 '18 at 9:23
Setsuna R SeieiSetsuna R Seiei
11
11
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3026857%2fkalman-filter-implementation-for-a-driving-simulation-in-a-final-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3026857%2fkalman-filter-implementation-for-a-driving-simulation-in-a-final-project%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown