Go to Post A couple of times during our matches, our HOSTBOT had a GAME PIECE right there ready to HANG, but the darn PEG dodged out of the way - MrForbes [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-02-2017, 12:52
Ty Tremblay's Avatar
Ty Tremblay Ty Tremblay is offline
Robotics Engineer
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Alton NH
Posts: 849
Ty Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond repute
SRX Motion Profiling Control

In this example, and in the documentation, we're told that we should run

Code:
_talon.processMotionProfileBuffer();
about twice as fast as the duration of our trajectory points.

I'm just curious why this is implemented this way. If I'm running a trajectory point every 20ms, why do I need to tell the Talon to process its points every 10ms?

I'm not asking about the timing, but more why the talon needs to be notified instead of processing the buffer on its own. I'm sure I'm missing something, but I would have expected to be able to tell the Talon to start processing its buffer, and then check to see if it's done.
__________________
Reply With Quote
  #2   Spotlight this post!  
Unread 02-02-2017, 12:54
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,729
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: SRX Motion Profiling Control

Quote:
Originally Posted by Ty Tremblay View Post
In this example, and in the documentation, we're told that we should run

Code:
_talon.processMotionProfileBuffer();
about twice as fast as the duration of our trajectory points.

I'm just curious why this is implemented this way. If I'm running a trajectory point every 20ms, why do I need to tell the Talon to process its points every 10ms?

I'm not asking about the timing, but more why the talon needs to be notified instead of processing the buffer on its own. I'm sure I'm missing something, but I would have expected to be able to tell the Talon to start processing its buffer, and then check to see if it's done.
Why I gotta tell the talon to do the thing?
Reply With Quote
  #3   Spotlight this post!  
Unread 02-02-2017, 15:55
Tyler Scheuble Tyler Scheuble is offline
Programming Lead
FRC #2471 (Team Mean Machine)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Vancouver, WA
Posts: 18
Tyler Scheuble is an unknown quantity at this point
Re: SRX Motion Profiling Control

Good question... I would love to know the answer for this as well.
Reply With Quote
  #4   Spotlight this post!  
Unread 02-02-2017, 16:52
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 559
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: SRX Motion Profiling Control

We could have baked in a thread task into the CANTalon class, but I thought this would be a simple way to ensure there are no reentrancy or other thread-related issues without requiring much more testing/complexity.

I also did not want teams scapegoating a talon thread as the reason why their heavily threaded FRC program is not working or why their CPU utilization is high.

Additionally we did not want to assume what the correct frequency to call was, however the function itself is pretty fast (does not considerably block).

This could change in the future. I figured only advanced users would use motion-profile, and most users would use motion-magic since you don't need to create a profile by hand (instead you set PIDF gains and cruisevel/accel to quickly get motion control).
Reply With Quote
  #5   Spotlight this post!  
Unread 02-02-2017, 17:06
Ty Tremblay's Avatar
Ty Tremblay Ty Tremblay is offline
Robotics Engineer
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Alton NH
Posts: 849
Ty Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond repute
Re: SRX Motion Profiling Control

Quote:
Originally Posted by ozrien View Post
We could have baked in a thread task into the CANTalon class, but I thought this would be a simple way to ensure there are no reentrancy or other thread-related issues without requiring much more testing/complexity.

I also did not want teams scapegoating a talon thread as the reason why their heavily threaded FRC program is not working or why their CPU utilization is high.

Additionally we did not want to assume what the correct frequency to call was, however the function itself is pretty fast (does not considerably block).

This could change in the future. I figured only advanced users would use motion-profile, and most users would use motion-magic since you don't need to create a profile by hand (instead you set PIDF gains and cruisevel/accel to quickly get motion control).
Thanks for the quick reply. Would this even have to be baked into the class? Would it be possible to do this logic entirely on the talon? Maybe then the API would be something like:
Code:
_talon.setMotionProfileUpdateRate(int ms)  //tells the talon how frequently to process its motion profile buffer.

_talon.startProcessingMotionProfile() //tells the talon to start processing its motion profile buffer.
Then we could use _talon.getMotionProfileStatus(_status); to determine if the MP has finished running.

One of the Talon's greatest advantages is the parallel processing it brings to FRC. If I could give a talon a MP, tell it to follow it, and check back in to determine when its done, I'd be sooooo happy.
__________________

Last edited by Ty Tremblay : 02-02-2017 at 17:11.
Reply With Quote
  #6   Spotlight this post!  
Unread 02-02-2017, 17:15
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 191
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
Re: SRX Motion Profiling Control

Quote:
Originally Posted by Ty Tremblay View Post
T
Code:
_talon.setMotionProfileUpdateRate(int ms)  //tells the talon how frequently to process its motion profile buffer.

_talon.startProcessingMotionProfile() //tells the talon to start processing its motion profile buffer.
Then we could use _talon.getMotionProfileStatus(_status); to determine if the MP has finished running.
Why not just calculate the rate by dividing the delta time on the points in the profile by 2? Most users will get it right but why make them supply a value that could be determined automatically.
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote
  #7   Spotlight this post!  
Unread 02-02-2017, 17:47
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 559
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: SRX Motion Profiling Control

Quote:
One of the Talon's greatest advantages is the parallel processing it brings to FRC. If I could give a talon a MP, tell it to follow it, and check back in to determine when its done, I'd be sooooo happy.
That is how it works. But if your MP is large then it can't be sent all at once. Instead it has to be streamed into the Talon as it executes, granted there is buffering in all the spots you would expect. The process function manages this periodically.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:58.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi