-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(multi_object_tracker): consider vehicle twist direction #4637
fix(multi_object_tracker): consider vehicle twist direction #4637
Conversation
7f19375
to
489493d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sense.
Could you add following two changes?
- add same changes to bicycle_tracker
twist_with_cov.twist.linear.x = X_t(IDX::VX) * std::cos(X_t(IDX::SLIP));
twist_with_cov.twist.linear.y = X_t(IDX::VX) * std::sin(X_t(IDX::SLIP));
- add document description in models.md
#### remarks on the output twist
Remarks that the velocity $v_{k}$ is the norm of velocity of vehicle, not the longitudinal velocity.
So the output twist in the object coordinate $(x,y)$ is calculated as follows.
$$
\begin{aligned}
v_{x} &= v_{k} \cos \left(\beta_{k}\right) \\
v_{y} &= v_{k} \sin \left(\beta_{k}\right)
\end{aligned}
$$
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
489493d
to
f2e6b80
Compare
@YoshiRi Thank you. I added them. |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #4637 +/- ##
=======================================
Coverage 14.89% 14.89%
=======================================
Files 1547 1547
Lines 106613 106599 -14
Branches 32603 32595 -8
=======================================
+ Hits 15876 15878 +2
+ Misses 73432 73417 -15
+ Partials 17305 17304 -1
*This pull request uses carry forward flags. Click here to find out more.
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
WalkthroughThe overall change focuses on fixing a bug in the twist direction calculation in the multi-object tracker code. The calculation of the linear and angular components of the twist is updated based on the slip angle ( Changes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Files selected (4)
- perception/multi_object_tracker/models.md (1)
- perception/multi_object_tracker/src/tracker/model/bicycle_tracker.cpp (1)
- perception/multi_object_tracker/src/tracker/model/big_vehicle_tracker.cpp (1)
- perception/multi_object_tracker/src/tracker/model/normal_vehicle_tracker.cpp (1)
Files skipped from review due to trivial changes (2)
- perception/multi_object_tracker/src/tracker/model/big_vehicle_tracker.cpp
- perception/multi_object_tracker/src/tracker/model/normal_vehicle_tracker.cpp
Review comments generated (2)
- Review: 1
- LGTM: 1
Tips
Chat with
CodeRabbit Bot (@coderabbitai
)
- Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
- Invite the bot into a review comment chain by tagging
@coderabbitai
in a reply.
Code suggestions
- The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
- You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.
Pausing incremental reviews
- Add
@coderabbitai: ignore
anywhere in the PR description to pause further reviews from the bot.
#### remarks on the output twist | ||
|
||
Remarks that the velocity $v_{k}$ is the norm of velocity of vehicle, not the longitudinal velocity. | ||
So the output twist in the object coordinate $(x,y)$ is calculated as follows. | ||
|
||
$$ | ||
\begin{aligned} | ||
v_{x} &= v_{k} \cos \left(\beta_{k}\right) \\ | ||
v_{y} &= v_{k} \sin \left(\beta_{k}\right) | ||
\end{aligned} | ||
$$ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments in this section provide an explanation of how the output twist in the object coordinate system is calculated. However, the comments are not formatted correctly and are missing the necessary syntax for mathematical equations. Additionally, the comments refer to variables and symbols that are not defined in this context.
To improve clarity, please update the comments as follows:
68: #### Remarks on the output twist
69: The velocity `v_k` represents the norm of the vehicle's velocity, not the longitudinal velocity.
70: To calculate the output twist in the object coordinate `(x, y)`, use the following formulas:
71:
72: ```
73: v_x = v_k * cos(beta_k)
74: v_y = v_k * sin(beta_k)
75: ```
76: Where:
77: - `v_x` is the linear x-component of the twist.
78: - `v_y` is the linear y-component of the twist.
79: - `beta_k` is the slip angle of the vehicle.
Please ensure that the variables and symbols used in the comments are consistent with their definitions in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…foundation#4637) * feat(multi_object_tracker): consider vehicle twist direction Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix bicycle model Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update doc Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
…foundation#4637) * feat(multi_object_tracker): consider vehicle twist direction Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix bicycle model Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update doc Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
…foundation#4637) * feat(multi_object_tracker): consider vehicle twist direction Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * fix bicycle model Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> * update doc Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com> --------- Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Description
Fixed the twist direction bug, which was the object's orientation, but actually the slip angle should be considered.
The kinematics model used in the tracker is CoG frame where the direction of twist and object orientation is not the same.
Tests performed
Effects on system behavior
Nothing
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.
Summary by CodeRabbit
Release Notes:
getTrackedObject
function of theBicycleTracker
,BigVehicleTracker
, andNormalVehicleTracker
classes to consider the slip angle.