-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Plot acceleration and jerk #14
base: master
Are you sure you want to change the base?
Conversation
Looks good to me @davidpilop , but I'm unable to run it from my local machine. I've got next stacktrace:
Seems like you have something similar to this: https://stackoverflow.com/a/38445459/1274904 Did you try to run it on your laptop? My setup:
|
@davidpilop The plot works for me. It pops up right from the beginning and keeps updating as the velocity changes. But there's an issue. The system is slowed down and the car moves with an extremely slow velocity (<2 mph). When I comment out Though a live plot looks very cool, a simpler solution would be just to accumulate 2000-3000 sample velocities, acc etc and just popping them up as one plot |
Send out circular waypoints
ros/src/twist_controller/dbw_node.py
Outdated
self.acceleration_plot.append((self.velocity_plot[i] - self.velocity_plot[i-1])/diff_time) | ||
self.jerk_plot.append((self.acceleration_plot[i] - self.acceleration_plot[i-1])/diff_time) | ||
|
||
if i % 2000 == 0: |
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.
@davidpilop Yep looks good to me, but If I am correct when @subhash suggested
Though a live plot looks very cool, a simpler solution would be just to accumulate 2000-3000 sample velocities, acc etc and just popping them up as one plot
he meant that once you handled 2000-3000
calls (up to you, in your case you decided to go with 2000
seems like) you should just execute the logic within this if condition statement and exit. So in here instead of checking for every 2000
calls with if i % 2000 == 0:
, you should probably check for the first 2000
calls only, so you should replace if i % 2000 == 0:
to if i == 2000:
and also after you show statistics in line 160 (https://github.com/subhash/CarND-Capstone/pull/14/files#diff-7fdad75c966f68bdd51946534578bb1fR160) with plt.show()
call you should exit by executing next instructionexit(0)
.
@subhash could you have a look?
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.
@volkodava @davidpilop The condition is fine for now, we can always quit ROS altogether once we get the plot.
Good job on getting the plot, but something is not right about the values.
We cannot be introducing acc or jerk at this level! Can you investigate. Otherwise, I can look at it tomorrow
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.
I think something of this sort is required:
if i>0:
self.acceleration_plot.append((self.velocity_plot[i] - self.velocity_plot[i-1])/diff_time)
if i>1:
self.jerk_plot.append((self.acceleration_plot[i-1] - self.acceleration_plot[i-2])/diff_time)
Still, we are not great on the jerk front ..
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.
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.
Still, we are not great on the jerk front ..
@subhash could you try to run the test with uncommented https://github.com/subhash/CarND-Capstone/blob/master/ros/src/waypoint_updater/waypoint_updater.py#L78 and commented out https://github.com/subhash/CarND-Capstone/blob/master/ros/src/waypoint_updater/waypoint_updater.py#L79 to verify if it helps with jerk?
@davidpilop I think this looks good. The problem is that this PR includes other unrelated commits already in the repo. Could you rebase on top of current master (or start from the current master and just apply your change) and resubmit the PR with only the plot code? |
No description provided.