@@ -185,11 +185,15 @@ void Update()
185185 rosDroneConnection . UploadWaypointsTask ( test_Task ) ;
186186 }
187187
188- // 3D Mapping hardcoded WPs here
188+ // This is for flying around B100 for mapping it
189+ // If yaw_turn_mode = True Untested: so ENSURE drone follows YAW angles correctly
190+ // If yaw_turn_mode = False, drone flies a regular mission, always pointing in the direction of flight. Make sure camera is mounted to the drone
191+ // using the mount that makes the camera pointed to the left.
189192 if ( Input . GetKeyUp ( uploadRFS_B100MappingMission ) )
190193 {
191194 uint [ ] command_list = new uint [ 16 ] ;
192195 uint [ ] command_params = new uint [ 16 ] ;
196+ bool yaw_turn_mode = false ;
193197 for ( int i = 0 ; i < 16 ; i ++ )
194198 {
195199 command_list [ i ] = 0 ;
@@ -200,42 +204,98 @@ void Update()
200204 // If so, 0 deg = North, 90 deg = East
201205 // N 0
202206 // 315 45
203- // W 270 E 90
207+ // W 270 *B100* E 90
204208 // 225 135
205209 // S 180
206210 //
207211
208- // flight path clockwise around B100 defined below:
209- // Start out in the field
210- MissionWaypointMsg mappingWP1 = new MissionWaypointMsg ( 37.915373f , - 122.337945f , 20.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
212+ MissionWaypointTaskMsg mapB100Task = null ;
211213
212- //NE Corner of B100
213- MissionWaypointMsg mappingWP2 = new MissionWaypointMsg ( 37.915279f , - 122.337941f , 20.0f , 3.0f , 225 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
214+ // UNTESTED WPs. Not considered safe until tested.
215+ //3D Mapping hardcoded yaw - adjusted WPs for mapping B100, for a drone outfitted with a forward - facing camera
216+ // Make sure drone's camera is pointing forward as drone is supposed to turn (yaw changing) to always face the building.
214217
215- //SE Corner of B100
216- MissionWaypointMsg mappingWP3 = new MissionWaypointMsg ( 37.915152f , - 122.337943f , 20.0f , 3.0f , 315 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
218+ if ( yaw_turn_mode )
219+ {
220+ // flight path clockwise around B100 defined below:
221+ // Start out in the field
222+ MissionWaypointMsg mappingWP1 = new MissionWaypointMsg ( 37.915373f , - 122.337945f , 20.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
223+
224+ //NE Corner of B100
225+ MissionWaypointMsg mappingWP2 = new MissionWaypointMsg ( 37.915279f , - 122.337941f , 20.0f , 3.0f , 225 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
226+
227+ //SE Corner of B100
228+ MissionWaypointMsg mappingWP3 = new MissionWaypointMsg ( 37.915152f , - 122.337943f , 20.0f , 3.0f , 315 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
217229
218- //SW Corner of B100
219- MissionWaypointMsg mappingWP4 = new MissionWaypointMsg ( 37.915153f , - 122.338110f , 20.0f , 3.0f , 45 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
230+ //SW Corner of B100
231+ MissionWaypointMsg mappingWP4 = new MissionWaypointMsg ( 37.915153f , - 122.338110f , 20.0f , 3.0f , 45 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
220232
221- //NW Corner of B100
222- MissionWaypointMsg mappingWP5 = new MissionWaypointMsg ( 37.915291f , - 122.338112f , 20.0f , 3.0f , 135 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
233+ //NW Corner of B100
234+ MissionWaypointMsg mappingWP5 = new MissionWaypointMsg ( 37.915291f , - 122.338112f , 20.0f , 3.0f , 135 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
223235
224- //NE Corner of B100
225- MissionWaypointMsg mappingWP6 = new MissionWaypointMsg ( 37.915279f , - 122.337941f , 20.0f , 3.0f , 225 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
236+ //NE Corner of B100
237+ MissionWaypointMsg mappingWP6 = new MissionWaypointMsg ( 37.915279f , - 122.337941f , 20.0f , 3.0f , 225 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
226238
227- // Back to out in the field
228- MissionWaypointMsg mappingWP7 = new MissionWaypointMsg ( 37.915373f , - 122.337945f , 20.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
239+ // Back to out in the field
240+ MissionWaypointMsg mappingWP7 = new MissionWaypointMsg ( 37.915373f , - 122.337945f , 20.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
229241
230- MissionWaypointMsg [ ] mappingWPs = new MissionWaypointMsg [ ] { mappingWP1 , mappingWP2 , mappingWP3 , mappingWP4 , mappingWP5 , mappingWP6 , mappingWP7 } ;
231- MissionWaypointTaskMsg mapB100Task = new MissionWaypointTaskMsg ( 8.0f , 4.0f , MissionWaypointTaskMsg . ActionOnFinish . NO_ACTION , 1 , MissionWaypointTaskMsg . YawMode . WAYPOINT , MissionWaypointTaskMsg . TraceMode . COORDINATED , MissionWaypointTaskMsg . ActionOnRCLost . FREE , MissionWaypointTaskMsg . GimbalPitchMode . FREE , mappingWPs ) ;
232- ViewHardcodedWaypoints ( mapB100Task ) ;
233- // Replace with below line for point-to-point transition between WPs instead of smooth (idk what it does)
234- // MissionWaypointTaskMsg test_Task = new MissionWaypointTaskMsg(8.0f, 4.0f, MissionWaypointTaskMsg.ActionOnFinish.NO_ACTION, 1, MissionWaypointTaskMsg.YawMode.WAYPOINT, MissionWaypointTaskMsg.TraceMode.POINT, MissionWaypointTaskMsg.ActionOnRCLost.FREE, MissionWaypointTaskMsg.GimbalPitchMode.FREE, mappingWPs);
242+ MissionWaypointMsg [ ] mappingWPs = new MissionWaypointMsg [ ] { mappingWP1 , mappingWP2 , mappingWP3 , mappingWP4 , mappingWP5 , mappingWP6 , mappingWP7 } ;
243+ mapB100Task = new MissionWaypointTaskMsg ( 8.0f , 4.0f , MissionWaypointTaskMsg . ActionOnFinish . NO_ACTION , 1 , MissionWaypointTaskMsg . YawMode . WAYPOINT , MissionWaypointTaskMsg . TraceMode . COORDINATED , MissionWaypointTaskMsg . ActionOnRCLost . FREE , MissionWaypointTaskMsg . GimbalPitchMode . FREE , mappingWPs ) ;
244+ ViewHardcodedWaypoints ( mapB100Task ) ;
245+ // Replace with below line for point-to-point transition between WPs instead of smooth (idk what it does)
246+ // MissionWaypointTaskMsg test_Task = new MissionWaypointTaskMsg(8.0f, 4.0f, MissionWaypointTaskMsg.ActionOnFinish.NO_ACTION, 1, MissionWaypointTaskMsg.YawMode.WAYPOINT, MissionWaypointTaskMsg.TraceMode.POINT, MissionWaypointTaskMsg.ActionOnRCLost.FREE, MissionWaypointTaskMsg.GimbalPitchMode.FREE, mappingWPs);
247+
248+ }
249+
250+ // Flies Counter clockwise (CCW) around B100 without any fancy yaw -- drone always points in the direction of flight, as is usual
251+ // These WPs lat/long are safe. Fly at high altitude to verify they're good. They also show up in Unity so you can see where they
252+ // are in relation to the building. I've flown with these lat/long through iPAD DJI GS Pro app, and then compied the lat/long values
253+ // to here so they are supposed to be safe if you use these. Just set the altitude to your preference.
254+ else if ( yaw_turn_mode == false )
255+ {
256+ // flight path ***COUNTER-CLOCKWISE*** around B100 defined below:
257+ // Start out next to building. Have drone hovering close to this WP when starting mapping routine on jetson computer.
258+ //NW Corner of B100
259+ MissionWaypointMsg mappingWP1a = new MissionWaypointMsg ( 37.915306300f , - 122.338041512f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
260+ MissionWaypointMsg mappingWP1b = new MissionWaypointMsg ( 37.915266382f , - 122.338096355f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
261+
262+ //SW Corner of B100
263+ MissionWaypointMsg mappingWP2a = new MissionWaypointMsg ( 37.915208625f , - 122.338096832f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
264+ MissionWaypointMsg mappingWP2b = new MissionWaypointMsg ( 37.915168440f , - 122.338051218f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
265+
266+ //SE Corner of B100
267+ MissionWaypointMsg mappingWP3a = new MissionWaypointMsg ( 37.915165315f , - 122.337991285f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
268+ MissionWaypointMsg mappingWP3b = new MissionWaypointMsg ( 37.915202140f , - 122.337917794f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
269+
270+ //NE Corner of B100
271+ MissionWaypointMsg mappingWP4a = new MissionWaypointMsg ( 37.915273840f , - 122.337920489f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
272+ MissionWaypointMsg mappingWP4b = new MissionWaypointMsg ( 37.915327647f , - 122.337965254f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
273+
274+ //NW Corner of B100
275+ MissionWaypointMsg mappingWP5 = new MissionWaypointMsg ( 37.915326300f , - 122.338047125f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
276+
277+ // Back to out in the field
278+ MissionWaypointMsg mappingWP6 = new MissionWaypointMsg ( 37.915387568f , - 122.337874484f , 10.0f , 3.0f , 0 , 0 , MissionWaypointMsg . TurnMode . CLOCKWISE , 0 , 30 , new MissionWaypointActionMsg ( 0 , command_list , command_params ) ) ;
279+
280+ MissionWaypointMsg [ ] mappingWPs = new MissionWaypointMsg [ ] {
281+ mappingWP1a ,
282+ mappingWP1b ,
283+ mappingWP2a ,
284+ mappingWP2b ,
285+ mappingWP3a ,
286+ mappingWP3b ,
287+ mappingWP4a ,
288+ mappingWP4b ,
289+ mappingWP5 ,
290+ mappingWP6 } ;
291+ mapB100Task = new MissionWaypointTaskMsg ( 0.5f , 0.5f , MissionWaypointTaskMsg . ActionOnFinish . NO_ACTION , 1 , MissionWaypointTaskMsg . YawMode . AUTO , MissionWaypointTaskMsg . TraceMode . COORDINATED , MissionWaypointTaskMsg . ActionOnRCLost . FREE , MissionWaypointTaskMsg . GimbalPitchMode . FREE , mappingWPs ) ;
292+ ViewHardcodedWaypoints ( mapB100Task ) ;
293+ }
235294
236295 rosDroneConnection . UploadWaypointsTask ( mapB100Task ) ;
237296 }
238297
298+
239299 if ( Input . GetKeyUp ( missionInfo ) )
240300 {
241301 rosDroneConnection . FetchMissionStatus ( ) ;
0 commit comments