jben
Our team can't get Simulink to work for the autonomous code. We have MATLAB downloaded, but the support packages won't download. Is there any way we can code autonomous using RobotC or any other program?
Quote 0 0
JoseAvendano
jben,

Please call our tech support department if you are having trouble installing the support package. They can help you immediately over the phone. Here are the details:

(508) 647-7000
https://www.mathworks.com/support/contact_us.html

You can also post some more details on the error message and we can take a look at it, also keep in mind that we stopped supporting the support package for MAC 🙁

As far as other code, I don't have samples for other products but maybe somebody has already worked on something they don't mind sharing?

I updated the title too in case somebody else can help 🙂

Best,

Jose
Quote 0 0
jgraber
Here is a tested working  C example from EasyC.   
Features Triggering 2 different Autonomous routines,  you may need up to 4?
Features Timed Driving with  SafeWait   methodology that allows Emergency STOP;  
If you don't have E-STOP feature,  if something goes wrong.....
   The only way to stop your rogue robot is to turn off the Joystick,  or pull out the Vexnet USB Key.

int STOP = 0;
int WaitTime = 0;
// MAIN Function ****************************************************************
void MyMain ( void ) {
while ( 1 ) { // repeat forever MAIN WHILE
// DRIVER CONTROL MODE, just 3 lines in this example
Arcade2 ( 1 , 2 , 1 , 9 , 2 , 0 , 0 ) ;
JoystickToServo ( 1 , 3 , 5 , 0 ) ;
JoystickToServo ( 1 , 4 , 6 , 0 ) ;

// Example Autonomous "Timed Driving" with abort function
// ********** Auto #1 ****** Use button B8 Up to STOP ********
if ( GetJoystickDigital (1, 8, 1) ) { // STARTING AUTON #1 with button B8-Down

SetMotor(2,100); // Right Wheel START Auton #1, segment 1
SetMotor(9, 00); // Left Wheel
// SafeWait( 4000 ); // could put in function if you know how
WaitTime = 4000;
while( ( (WaitTime -= 10) > 0) && STOP == 0 )
{ Wait( 10 ); if (GetJoystickDigital (1, 8, 2)) { STOP = 1; } }
SetMotor(2,0); SetMotor(9,0); // Stop Wheels at END OF SEGMENT

SetMotor(2,00); // Right Wheel START Auton #1, segment 2
SetMotor(9,00); // Left Wheel
WaitTime = 1000;
while( ( (WaitTime -= 10) > 0) && STOP == 0 )
{ Wait( 10 ); if (GetJoystickDigital (1, 8, 2)) { STOP = 1; } }
SetMotor(2,0); SetMotor(9,0); // Stop Wheels at END OF SEGMENT

STOP = 0; // Reset; Auton #1 LAST Segment
SetMotor(2,0); SetMotor(9,0); // Safety stop wheels
} // End of AUTONOMOUS Routine #1

// ********** Auto #2 ****** Use button B8 Up to STOP ********
if ( GetJoystickDigital (1, 8, 4) ) { // STARTING AUTON Routine B8-Right
SetMotor(2, -50); // Right Wheel Segment 1 start
SetMotor(9, -50); // Left Wheel
WaitTime = 2000;
while( ( (WaitTime -= 10) > 0) && STOP == 0 )
{ Wait( 10 ); if (GetJoystickDigital (1, 8, 2)) { STOP = 1; } }
SetMotor(2,0); SetMotor(9,0); // Stop Wheels at end of segment

STOP = 0; // Reset; Auton #1 LAST Segment
SetMotor(2,0); SetMotor(9,0); // Safety stop wheels
} // End of AUTONOMOUS Routine #2

} // end main WHILE
} // END BLOCK MYMain
Quote 0 0