Autonomous program code help

Hi, I volunteered to help an elementary school robotics team this year in order for the school to keep the robotics team going. Pervious teacher/coach moved away. Luckily we found a teacher to sponsor if I helped coach. We have a team this year that has worked really hard to get an autonomous program coded. I am not a coder and they have actually showing me how to code, so I am of little help. But they have a problem they can not figure out.

They are starting in zone 2 and use a piece to touch the wall. The robot drives to the goal shoots the catapult no problem. It then drives back to zone 2 picks up a ball returns to the goal. But it does not shoot, the robot just sits there until the wait is up. Then it starts to drive back to zone 2 and it shoots. The first time it will be about 6-8 inches away from the goal and progressively increases distance with each repetition.

Things I know they have tried to do to fix:
Increased, decreased and remove the ‘wait’ both before and after the fire shoot command.
Increased and decreased the travel velocity.
Adjust the tensioner to accommodate for the distance from the goal but the distance in not consistent.
Removed the repeat.

Side note: when they started programing this they were starting from the sidewall. The turn to line up with the goal was very in inaccurate. I think the omni-wheels would cause it to overshoot and then it would not correct itself to the correct heading. If anyone knows how to fix that as well that would be great. But I bring it up to say that when they were running the code that way the catapult would fire correctly every time. It just was not lined up with the goal. We do not know why now it will not do the same.

Also if anyone know how to get the distance sensor code to work but the travel distance method seems to work fine.

Any answers or ideas to help these kids would be great. Thank you



Wow! As a vex v5 team, i don’t really know iq stuff, but thats some really advanced code!

4 Likes

For the issue of the ball not firing when expected, try seeing if you have a sensor that is messing up the timing and other things. If not, then try seeing if you have another hidden line of code, or maybe, there is an issue with the mechanism in the bot itself.

For the issue of the bot moving away from the goal, it is probably drift, as the omni wheels allow the bot to move freely, but can also lead the bot to continue sliding. If this is the case, try lowering the numbers by a small amount to see if the drift can then put the bot into place.

I’m not sure how to fix the other issues though.

Thank you for the advice Dan.
The team may know but I know I do not. How would they look for and/or find a hidden line of code?

The only sensor in use I believe is the touch sensor but I will have them check. They were trying to use the distance sensor to stop it at the goal but it did not seem to work. The bot would continue to drive it the goal and continue to still try to drive.

The mechanism works fine in driver mode. They even had a code where they sat it in front of the goal and had it alternate high and low goal shot with no problem.

Also late today the teacher text and said at recess the kids said it was now delayed firing every time and they had not made any changes to the program. I know this morning (Wed) they said they had not made any changes since yesterday because they do not know what else to try.

I only have a vary basic understanding of code. But I thought and would think it would go line by line. I really find it odd it would skip over a line and then go back.

If anyone has any further input we’ll take it. They still have not figured out what the problem is. Any help is greatly appreciated.

try adding a bumper to the back of the bot and when it is touch the robot will shoot

Unfortunately they did not design their robot to touch the goal when it shoots. Thank you for the suggestion though.