|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
SRX Motion Profiling Control
In this example, and in the documentation, we're told that we should run
Code:
_talon.processMotionProfileBuffer(); 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. |
|
#2
|
|||||
|
|||||
|
Re: SRX Motion Profiling Control
Quote:
|
|
#3
|
|||
|
|||
|
Re: SRX Motion Profiling Control
Good question... I would love to know the answer for this as well.
|
|
#4
|
||||
|
||||
|
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). |
|
#5
|
||||
|
||||
|
Re: SRX Motion Profiling Control
Quote:
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. 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. |
|
#6
|
||||
|
||||
|
Re: SRX Motion Profiling Control
Quote:
|
|
#7
|
||||
|
||||
|
Re: SRX Motion Profiling Control
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|