3/18/2024 0 Comments Robotc code examplesThere is a couple of things here priority becomes irrelevant. They could be made to work, maybe, maybe not (and you need quite a few changes to even try). First, do not use tasks - this is NOT what robotC tasks are for. Let me give you some psuedo code appropriate for robotC, that puts you on a better path. Short answer no you really need to do things quite a bit differently. with what angle) and better decide how to get back on track (i.e. Obviously, with a matrix of light sensors, you can better judge how badly you are going out of track (i.e. shouldn't happen, but go on spiral anyway task evade() else if (SensorValue(ls_left) > threshold Once the line is found track should take over. The correct flow should be that find should guide the robot to the line using a spiral path to find the line. I have this small section of RobotC code that I'm working on for a line following robot but am not sure I am doing it right as currently the track method will always take over the find method. Others use the endTimeSlice() and allow the arbiter to really choose. I've been doing a lot of reading lately about Subsumption Architecture and there are a few different ways people seem to advocate.įor instance some people use a global "flag" variable to have a task take control.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |