All Posts (14048)
Sort by
void switch_event(byte switchPosition){ switch(switchPosition) { case 1: // First position set_mode(MANUAL); // this is handy function to restart your mission: reset_waypoint_index(); break; case 2: // middle position set_mode(AUTO); break; case 3: // last position set_mode(STABILIZE); break; }}The next most important event is a waypoint event. There are a few basic events called (more will be added as necessary.) In the example below Loiter mode is turned on when we load WP 3. The variable elapsedTime is set to 0 ( elapsedTime is a user defined timer that increments in milliseconds.) If you want to stop Loitering after a set number of seconds, see the next example below.
void waypoint_event(byte event){ switch(event) { case EVENT_WILL_REACH_WAYPOINT: // called just before wp_index is incemented Serial.print("Reached WP:"); Serial.println(wp_index,DEC); break; case EVENT_SET_NEW_WAYPOINT_INDEX: // called just after wp_index is incemented Serial.print("Now going to WP:"); Serial.println(wp_index,DEC); break; case EVENT_LOADED_WAYPOINT: // called just after wp is loaded from memory Serial.print("Loaded WP index: "); Serial.println(wp_index,DEC); print_current_waypoint(); // custom loitering code if (wp_index == 3){ set_mode(LOITER); elapsedTime = 0; } break; // called when the pattern to be flown is automatically restarted case EVENT_LOOP: Serial.println("Looped WP Index"); print_current_waypoint(); break; }}The mainLoop_event is called with every execution of the control loop. Here is a good place to check the elapsedTime variable to escape Loiter mode and continue on with the mission.
// called AFTER every control loopvoid mainLoop_event(void){ if (control_mode == LOITER){ if (wp_index == 2 && elapsedTime > 120000 ){ // 2 minutes elapsedTime = 0; // our waypoints index is not altered during LOITER // All we need to do is reload the waypoint load_waypoint(); // and return to Autopilot mode! set_mode(AUTO); } }}Other events include:void gps_event(void)void low_battery_event(void)void failsafe_event()More will be added as necessary, and of course, you can add your own.JasonNext installment - The Mission Simulator
GAUI TG-609 from Michael Yang on Vimeo.
The civilian version of the Osprey V22 tilt rotor is the TG-609. Such a vertical take off, fixed wing flight platform has long been a UAV dream, but it's proven too tricky for RC modeling to date. Now Gaui seems to have cracked the code. After more than a year of development, mostly on working on the transition from heli mode to fixed wing mode, it appears ready to release the plane. The above video gives a sense of how it will fly; although it doesn't show full fixed wing mode yet, it's at least half-way there. It's not for sale yet, but apparently Empire RC will be the distributor in the US. I'm not sure this is the ideal UAV platform, due to limited payload capacity and very sensitive CG. But if you want something with the launch flexibility of a heli and the duration and flight effeciency of a plane, maybe this is worth checking out. Here's a bunch of pictures of the aircraft on the ground and in flight.