Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CSE-478wi
lab2
Commits
2687e10e
Commit
2687e10e
authored
Feb 14, 2020
by
Kay
Browse files
Update jupyter plotting tool
parent
a2dbd31c
Changes
1
Show whitespace changes
Inline
Side-by-side
bags/Controller Plotting.ipynb
View file @
2687e10e
...
...
@@ -32,20 +32,21 @@
bag
=
rosbag
.
Bag
(
bag_name
)
error
=
[]
poses
=
[]
speeds
=
[]
path
=
None
for
topic
,
msg
,
t
in
bag
.
read_messages
(
topics
=
[
'/controller/cte'
,
'/
sim_car_pose/
pose'
,
'/controller/path/poses'
,
'/vesc/high_level/ackermann_cmd_mux/input/nav_0'
]):
if
'cte'
in
topic
:
for
topic
,
msg
,
t
in
bag
.
read_messages
(
topics
=
[
'/controller/cte'
,
'/
car_
pose'
,
'/controller/path/poses'
,
'/vesc/high_level/ackermann_cmd_mux/input/nav_0'
]):
if
'
/controller/
cte'
in
topic
:
error
.
append
(
msg
.
data
)
if
'
sim
'
in
topic
and
path
is
not
None
:
if
'
/car_pose
'
in
topic
and
path
is
not
None
:
pose
=
pose_to_config
(
msg
.
pose
)
poses
.
append
(
pose
)
if
'nav'
in
topic
and
path
is
not
None
:
speeds
.
append
(
msg
.
drive
.
speed
)
if
'/controller/path/poses'
in
topic
:
path
=
map
(
pose_to_config
,
msg
.
poses
)
if
'/vesc/high_level/ackermann_cmd_mux/input/nav_0'
in
topic
and
path
is
not
None
:
speeds
.
append
(
msg
.
drive
.
speed
)
plt
.
figure
(
1
)
plt
.
subplot
(
221
)
plt
.
plot
(
error
)
plt
.
axhline
(
0
,
color
=
'grey'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment