|
Page 1 of 1
|
[ 7 posts ] |
|
Appropriate use case for multitasking?
Author |
Message |
Ernest3.14
Professor
Joined: Sat May 18, 2013 1:24 pm Posts: 271 Location: Olympia, WA
|
 Appropriate use case for multitasking?
Given the multitasking sticky, I'd like to confirm that this is an acceptable use of multitasking in RobotC.
In essence, I would like to have two tasks running at the same time: The main one would respond to sensors and decide on actions, most importantly the set points for each motor. Then, another task would be a PID control loop (due to complicated reasons we can't use the built-in PID control) which constantly adjusts the motor power. There are multiple motors to be controlled, and each iteration of the main task might only change the set points of some motors.
This is an appropriate use of multitasking, because the tasks are simultaneous, and not sequential--right?
_________________FTC Team 6424, the 'Oly Cow - Chief programmer. FRC Team 4450, Olympia Robotics Federation (ORF). and also quadrotors. Quadrotors!
|
Fri Jun 21, 2013 4:58 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Appropriate use case for multitasking?
So you have one task settings encoder positions, and another controlling the motors to get to those positions, yes? That sounds alright to me. It'd be what I'd do.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Fri Jun 21, 2013 5:04 pm |
|
 |
Ernest3.14
Professor
Joined: Sat May 18, 2013 1:24 pm Posts: 271 Location: Olympia, WA
|
 Re: Appropriate use case for multitasking?
Ok. Thanks!
_________________FTC Team 6424, the 'Oly Cow - Chief programmer. FRC Team 4450, Olympia Robotics Federation (ORF). and also quadrotors. Quadrotors!
|
Fri Jun 21, 2013 10:55 pm |
|
 |
roboRed
Expert
Joined: Fri Nov 02, 2012 12:07 am Posts: 163 Location: California, USA
|
 Re: Appropriate use case for multitasking?
One way that I think is helpful to decide whether or not I would use multiple sequence beams in NXT-G. Provided that there are some exceptions to the rule that I have to ask about. 
_________________ string Robored = "Awesome" ~~Neil Balch~~
|
Sat Aug 03, 2013 12:09 am |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Appropriate use case for multitasking?
Ugh. NXT-G... Sequence beams are my worst enemy.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Sat Aug 03, 2013 9:23 am |
|
 |
MHTS
Guru
Joined: Sun Nov 15, 2009 5:46 am Posts: 1523
|
 Re: Appropriate use case for multitasking?
Like I said in my previous posts, I have not found a single scenario that I really need to use RobotC tasks. Unless you are very experienced in multi-tasking programming, there are a lot of gotchas you need to deal with. Everything could be accomplished with using just the main task if your code can cooperate. For details on how this could be done, you may want to read my previous posts. search.php?keywords=cooperative&terms=all&author=mhts&sc=1&sf=all&sk=t&sd=d&sr=posts&st=0&ch=300&t=0&submit=Search
|
Sat Aug 03, 2013 12:44 pm |
|
 |
roboRed
Expert
Joined: Fri Nov 02, 2012 12:07 am Posts: 163 Location: California, USA
|
 Re: Appropriate use case for multitasking?
I know, But The Analogy Works.
_________________ string Robored = "Awesome" ~~Neil Balch~~
|
Sat Aug 03, 2013 12:50 pm |
|
|
|
Page 1 of 1
|
[ 7 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 2 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|