Simulating autonomous mode - i need help!! :(

Hi, im kinda nooby with the programming so id apreciate if u help me, i noticed that in the main function the condition for autonomous mode is that autonomous_mode will have a value, but can i control this value in order to make the autonomous mode work so i can see the whole camera thing working?
i realy hope im making sense here and that someone will help me.

Thank you for your time!

Rather than directly manipulating that variable (can be dangerous* if you forget to remove the code), what we did last year was something like this:

if(autonomous_mode || p3_sw_trig)

This way, it would still work normally in competition, and if we had a joystick connected to port 3, we could trigger it at will.

*The reason this is dangerous is simply if you lock autonomous_mode to 1 then forget to remove it later (it can happen, trust me), your team will be angry at you because your robot never left autonomous mode. Likewise, if you hardcode it to 0, then your team will be angry because your autonomous mode never worked. The or I propose here allows you to simply attach a joystick to port 3. Once you’re done, just put tape on port 3 saying “programmers only” so that no-one triggers it by accident.

The ideal way to do this is to make a competition port. However, I know very few details about how to do that, so someone will have to post details on that.

well, the thing is, i totaly understood what u posted but i dont understand something a lot basic than that, i dont understand what determines the value of autonomous_mode in the first place, it seems logical to me that we will have a switch that determines if the robot is in autonomous mode or regular mode, so how can i determine the value of autonomous_mode? or am i jsut getting it all wrong lol :yikes:

The value of autonomous_mode is set by the main field computer, its totally out of your control. It happens automagically. :slight_smile:

Itay,

The best way is to leave the code alone and build a competition port dongle.

Regards,

Mike

Thank u all guys uve helped me a lot, i got what ur saying now, i guess id knew that if it wasnt our first year in FIRST good to have so many ppl helping. :slight_smile: