Re: [drones-discuss] First time SITL for ArduCopter not executing flight plan, missing instructions?

3,514 views
Skip to first unread message

Jonathan Challinger

unread,
Apr 25, 2014, 2:06:46 PM4/25/14
to drones-...@googlegroups.com

1. You must load the parameters for SITL from Tools/autotest/ArduCopter.parm
2. You must raise the throttle (rc 3 1500) to start the mission.

On Apr 25, 2014 10:47 AM, "Francis Chan" <poi...@gmail.com> wrote:
Hey all,

I've been trying to validate my fork and run a SITL loop since I want to make sure I know how to test the code before I actually develop.

./sim_vehicle.sh -v ArduCopter -f quad --quadcopter --aircraft testquad --console -map

  1. At first APM keeps reporting "APM: PreArm: RC not calibrated".  So I run "param set ARMING_CHECK 0" and that error goes away [https://github.com/tridge/MAVProxy/issues/11]
  2. Then I run "wp load ./ArduPlane-Missions/CMAC-toff-loop.txt".  APM reports flight plan received.
  3. Followed by the command "auto".  Nothing happens.
  4. Maybe I need to arm the motors?  arm.  Nope, i need to give it another option.
  5. Maybe I should do an arm uncheck?  arm uncheck all.  Cool, no more APM prearm failures.  I think this pretty much says to ignore all pre-arm failures? MavProxy doesn't document this (besides "arm")?
  6. Try arming the throttle?  arm throttle.  APM reports success on ARMing now.  Great.
  7. I clear the waypoints.  wp clear.
  8. Then reload the waypoints.
  9. Then run "auto".
  10. Nothing happens.
I feel like I'm missing something on how to run SITL successfully.

The Console does report some odd negative numbers like Alt -3, Roll and Pitch oscillating between +/-5  Could there be something there that is preventing the mission plan from being executed?

Thanks in advance!

--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

viky

unread,
May 5, 2014, 7:32:29 AM5/5/14
to drones-...@googlegroups.com
    Hi,     
                   Today i had updated the Ardupilot directory from Github Trunk , so tried the new commands for SITL with "sim_vehicle.sh".
But i did not get any quad icon on the map, and on "status" command the lat, lon values are zero. Even with Auto command it doesnt takeoff , alt remains zero .
Am i missing any other file to run .. I followed as its given in instructions SITL on Linux . It seems its not getting any GPS update . Please let me know if anything else to be added in this setup.

Thanks 
Viky

Bruce Crevensten

unread,
May 5, 2014, 3:11:19 PM5/5/14
to drones-...@googlegroups.com
Hi Viky, I'm seeing some similar difficulties right now with sim_vehicle and Copter (Ubuntu 12 VM).  (I'm using sim_vehicle OK with Plane, so maybe there's some loose ends we need to figure out here for Copter).

Here's my steps:

cd /path/to/ArduCopter directory
../Tools/autotest/sim_vehicle.sh --map --console

(in MAVProxy console):
param load ../Tools/autotest/copter_params.parm
wp load ../Tools/autotest/copter_mission.txt
rc 3 1500
auto

I may be getting different results from you -- GPS looks fine to me, map shows with Quad symbol, etc, but the quad doesn't seem to take off.

I haven't done any diagnosis yet, just letting you know I'm seeing some related issues.

Bill Bonney

unread,
May 5, 2014, 4:59:55 PM5/5/14
to drones-...@googlegroups.com
Here's my steps:

cd /path/to/ArduCopter directory
../Tools/autotest/sim_vehicle.sh --map --console

(in MAVProxy console):
param load ../Tools/autotest/copter_params.parm
wp load ../Tools/autotest/copter_mission.txt
rc 3 1500
auto
You will need to type ‘arm throttle’ . I’d recommend doing that before switching to auto, but can be done after the mode switch. But you cannot arm with the throttle at 1500

Skype me if you need more help

Bill

Lost your multi-rotor - Try FIND MY DRONE™ on the App Store 
--------------------------------------------------------
bill bonney - 
mobile software developer
communis technologies
skype: maninvan

vikram kadian

unread,
May 6, 2014, 1:08:55 AM5/6/14
to drones-...@googlegroups.com
Hi Bruce,
                     Its working for me, In my setup sim_multicopter.py was not called from sim_vehicle.sh, so i run it independently. Here are the steps i followed:

1. Go to ardupilot/ArduCopter folder and enter : sim_vehicle.sh -v ArduCopter --console --map --aircraft test

2.For sim_multicopter.py(U may not need this step since its already called in above command but in my case it wasn't working, so i called it seperately) . Got to ardupilot/Tools/autotest/pysim and enter : ./sim_multicopter.py --home=-35.362938,149.165085,584,270

3. Load the waypoints :
Stabilize > wp load ./ArduPlane-Missions/CMAC-toff-loop.txt

4. Arm the throttle:  
Stabilize> arm throttle

If you r getting some error like  APM: PreArm: INS not calibrated , then arm uncheck ins  and arm throttle again.

5. Enter in Auto Mode:
Stabilize >AUTO

6 Increase the throttle
AUTO > rc 3 1500

and enjoy your simulated flight , This is how it worked for me , Bill correct me if i am wrong anywhere. Bruce just try this and check it should work for you too. 
 
 Viky



--
You received this message because you are subscribed to the Google Groups "drones-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drones-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
VIKRAM KADIAN

Ben Nizette

unread,
May 6, 2014, 2:07:20 AM5/6/14
to drones-...@googlegroups.com
Hi Viky,

Hm, the only difference I can see between the way you call sim_multicopter and the way that it is called from within sim_vehicle is the explicit set of the --frame type. Can you try running sim_multicopter --frame=quad and seeing whether it throws an error? If not then i guess it's some kind of timing thing, is this being done in a VM?

As a general point for the folks in this thread, if you run sim_vehicle with the '-w' switch then it will reload default parameters, this is useful the first time you run for a particular frame type (though it's no different to just "param load"ing them yourself if you can remember the param file name).

The INS arming check should be overcome by running "level" rather than disabling the check.  No harm done as the simulated sensors are perfectly aligned in the body frame, but you never know, there might come a day when we decide that bad alignment is something that should be simulated too :)

Cheers,
  --Ben.

vikram kadian

unread,
May 7, 2014, 1:57:35 AM5/7/14
to drones-...@googlegroups.com
Hi Ben ,
            Thanks for your brief explanation. I am using Ubuntu on VM setup and running Mission Planner on Windows. I tried with the -frame X comand with sim_vehicle, it doesn't show any error and runs in a similar way as it was earlier. Thanks for INS clarification the ground or level command initialize it well with new calibrations. I am happy, SITL is running well and i can simulate the new code changes with it now . 
But if i can add the flightgear simulation in it , it will be better and a good simulation environment for me. I could not find any instruction to integrate Flight gear with Mission planner. My setup is SITL on VMware Ubuntu --> Mission planner on Window --> FlightGear in Window. Please share if you have any idea about it. Thanks again Ben

Ben Nizette

unread,
May 7, 2014, 2:23:53 AM5/7/14
to drones-...@googlegroups.com
Hi Viky,

Nope, sorry, I'm not the right person to ask about that second problem.  Are you doing Plane or Copter sims? AFAIK the Flightgear stuff, or at least certainly the JSBSim backend that's used in SITL, is only set up for Plane.

If you are using Plane, then it should be as simple as setting --rcin --rcout --fgout to jsbsim/runsim.py when it's run from e.g. sim_vehicle.sh (famous last words!).  Use the same port numbers but the IP address of the Windows machine.  Could be dead wrong..

Ben.

vikram kadian

unread,
May 7, 2014, 2:28:55 AM5/7/14
to drones-...@googlegroups.com
Hi Ben,

I am using it for Quadcopter, i found few commands to run fg on linux so will try to run the flightgear on VMware Ubuntu after installing it. 
  

Viky

Ben Nizette

unread,
May 7, 2014, 3:09:37 AM5/7/14
to drones-...@googlegroups.com
OK sure, though I still think that FG, Windows or Linux, is not set up for 'copter.  sim_multicopter.py essentially takes its place.  But, if you manage to get it working by means of new FG scripts and associated wizardry, that's great!  (If I'm mistaken, that's even better :)

Ben.

Francis Chan

unread,
May 8, 2014, 11:17:59 AM5/8/14
to drones-...@googlegroups.com
Ok I'll give that a try.

Clay McClure

unread,
Oct 31, 2014, 11:05:47 PM10/31/14
to drones-...@googlegroups.com
For posterity, the magic incantation that worked for me (as a first-time SITL and MAVProxy user) was:

STABILIZE> wp load ../Tools/autotest/copter_mission.txt
STABILIZE> level
STABILIZE> arm throttle
STABILIZE> auto
AUTO> rc 3 1500

At that point, the copter lifted off and flew the mission!

Would it be possible to add the missing steps to the wiki?


Cheers,

Clay
Reply all
Reply to author
Forward
0 new messages