Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asclinic-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiaao Liu
asclinic-system
Commits
033c5bd9
Commit
033c5bd9
authored
11 months ago
by
Jiaao Liu
Browse files
Options
Downloads
Patches
Plain Diff
dump the long distance marker result, correct covariance matrix in kalman
parent
980e3dec
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
catkin_ws/src/asclinic_pkg/src/Kalman.cpp
+10
-10
10 additions, 10 deletions
catkin_ws/src/asclinic_pkg/src/Kalman.cpp
catkin_ws/src/asclinic_pkg/src/image.py
+17
-10
17 additions, 10 deletions
catkin_ws/src/asclinic_pkg/src/image.py
with
27 additions
and
20 deletions
catkin_ws/src/asclinic_pkg/src/Kalman.cpp
+
10
−
10
View file @
033c5bd9
...
...
@@ -137,10 +137,10 @@ void ImageAnswer(const asclinic_pkg::position msg){
y
,
phi
;
MatrixXd
new_pose
=
odo_position
+
K
*
(
z_position
-
odo_position
);
if
(
std
::
isnan
(
x
)
||
std
::
isnan
(
y
)
||
std
::
isnan
(
phi
))
{
x
=
odo_position
(
1
);
y
=
odo_position
(
2
);
phi
=
odo_position
(
3
);
if
(
std
::
isnan
(
new_pose
(
0
)
)
||
std
::
isnan
(
new_pose
(
1
)
)
||
std
::
isnan
(
new_pose
(
2
)
))
{
x
=
odo_position
(
0
);
y
=
odo_position
(
1
);
phi
=
odo_position
(
2
);
ROS_INFO_STREAM
(
"fail!!!!!!!!!!!!!!!!!!!!!!!!!!"
);
}
else
{
...
...
@@ -187,13 +187,13 @@ int main(int argc, char **argv) {
time_now
=
ros
::
Time
::
now
();
last_time
=
ros
::
Time
::
now
();
pose_covariance
<<
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
,
1
;
pose_covariance
<<
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
;
z_cov
<<
0.07246
,
-
0.05582
,
-
0.01839
,
-
0.05582
,
0.32237
,
0.46697
,
-
0.01839
,
0.46697
,
0.20327
;
z_cov
<<
0.07246
,
0.05582
,
0.01839
,
0.05582
,
0.32237
,
0.46697
,
0.01839
,
0.46697
,
0.20327
;
m_subscriber
=
nh
.
subscribe
(
"/asc/encoder_counts"
,
1
,
answer
);
image_subscriber
=
nh
.
subscribe
(
"/image_estimation"
,
1
,
ImageAnswer
);
...
...
This diff is collapsed.
Click to expand it.
catkin_ws/src/asclinic_pkg/src/image.py
+
17
−
10
View file @
033c5bd9
...
...
@@ -50,10 +50,8 @@ def answer_callback(msg, markers, publisher):
x_avg
=
0
y_avg
=
0
phi_avg
=
0
matrix_ctow
=
np
.
array
([[
0
,
0
,
1
],
[
-
1
,
0
,
0
],
[
0
,
-
1
,
0
]])
mini_d
=
1000
valid_number
=
0
for
fiducial_marker
in
msg
.
markers
:
id
=
fiducial_marker
.
id
for
marker
in
markers
:
...
...
@@ -64,7 +62,10 @@ def answer_callback(msg, markers, publisher):
rx
=
fiducial_marker
.
rvec
[
0
]
ry
=
fiducial_marker
.
rvec
[
1
]
rz
=
fiducial_marker
.
rvec
[
2
]
now_d
=
math
.
sqrt
(
tx
**
2
+
tz
**
2
)
if
now_d
>
4
:
continue
valid_number
+=
1
# Compute rotation matrix
npary
=
np
.
array
([
rx
,
ry
,
rz
])
rospy
.
loginfo
(
"
id is:
"
+
str
(
marker
.
id
))
...
...
@@ -86,16 +87,22 @@ def answer_callback(msg, markers, publisher):
#rospy.loginfo("x_mtoc_world" + str(position_inertia_frame[0]) + " z_mtoc_world " + str(position_inertia_frame[1]))
x
=
position_inertia_frame
[
0
]
+
marker
.
position
[
0
]
y
=
position_inertia_frame
[
1
]
+
marker
.
position
[
1
]
rospy
.
loginfo
(
"
x
"
+
str
(
x
)
+
"
Y
"
+
str
(
y
)
+
"
phi
"
+
str
(
marker
.
get_angle
()
+
ry
))
phi_now
=
marker
.
get_angle
()
+
ry
phi_now
=
normalize_angle
(
phi_now
)
#if phi_now>1.8*math.pi:
#phi_now = -(2*math.pi - phi_now)
rospy
.
loginfo
(
"
x
"
+
str
(
x
)
+
"
Y
"
+
str
(
y
)
+
"
phi
"
+
phi_now
)
phi_avg
+=
marker
.
get_angle
()
+
ry
if
now_d
<
mini_d
:
phi_avg
==
phi_now
x_avg
+=
x
y_avg
+=
y
x_avg
/=
num_mark
er
s
y_avg
/=
num_mark
er
s
phi_avg
/
=
num_markers
x_avg
/=
valid_numb
er
y_avg
/=
valid_numb
er
phi_avg
=
phi_avg
phi_avg
=
normalize_angle
(
phi_avg
)
if
x_avg
!=
0
or
y_avg
!=
0
or
phi_avg
!=
0
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment