Servers by jDrones

Dronekit-SITL question


(Ben Reich) #1

Can anyone tell me how to run dronekit sitl with version 3.5 of copter. I can only find version 3.3 when I do dronekit-sitl download.

Thanks so much!


(peterbarker) #2

Can anyone tell me how to run dronekit sitl with version 3.5 of copter. I
can only find version 3.3 when I do dronekit-sitl download.

Sorry, no precompiled binaries are available for 3.5

When using dronekit-sitl with my own binaries I tend to supply the path=
named parameter to dronekit-sitl’s constructor.

This does require compiling your own ardupilot binary, of course.

https://github.com/dronekit/dronekit-python/blob/source-system-filtering/examples/avoidance/avoidance.py#L66


(Ben Reich) #3

Thanks for the quick answer?.

Any specific reason for that?

I just don’t want to learn how to build it if I do not have to.

Best


(peterbarker) #4

Thanks for the quick answer?.
Any specific reason for that?

Lack of time and knowledge would be a start to it :slight_smile:

I just don’t want to learn how to build it if I do not have to.

Sorry. But it is good for you (just ask your surgeon-general).

Note that the binary in question here is our bog-standard SITL binary. So
you’d use something like:

AP_BINARY="$HOME/rc/ardupilot/build/sitl-debug/bin/arducopter"
python example.pl --path="$AP_BINARY" …

Peter


(Ben Reich) #5

Peter - thank you so much. Are there instruction on how to build copter 3.5 on Windows?


(peterbarker) #6

Peter - thank you so much. Are there instruction on how to build copter 3.5 on Windows?

Step 1: Install Linux.

OK, so that’s just the way my instructions would start :wink: Maybe try this
link instead:

http://ardupilot.org/dev/docs/building-ardupilot-onwindows10.html

Yours,


(Ben Reich) #7

Thanks Peter,

Sorry for the nag. I am simply using machines that do not allow the changes that are required in Windows to build for security reasons. Since I am in a secure environment there are many limitations.

Can I build it on one machine and use it in others or do I need to build it on the same machine I use it on?

Can I copy it from someone who already has built it?

I need it because there seem to be many bugs in the available 3.3.

Ben


(peterbarker) #8

Sorry for the nag. I am simply using machines that do not allow the changes
that are required in Windows to build for security reasons. Since I am in a
secure environment there are many limitations.

Heh. Careful with your wording. “secured” environment, perhaps.
“secure” is almost certainly not the case :wink:

Can I build it on one machine and use it in others or do I need to build it
on the same machine I use it on?

So long as the machines are close in configuration you should be able to
copy with binary around.

Can I copy it from someone who already has built it?

Again, so long as the binaries are close.

I need it because there seem to be many bugs in the available 3.3.

The software has vastly increased in capability since 3.3 too.

ATM we don’t create SITL binaries for firmware.ardupilot.org. Making x86
SITL binaries available for Linux available on firmware.ardupilot.org
would actually be pretty straight forward. Windows binaries -
not-so-much.

Perhaps you could consider using an AWS instance to create your binaries
on?

Ben

Yours,


(Ben Reich) #9

Hey Peter,

Continuing the saga…

I took your advice on trying to build sitl on an AWS ubuntu server.

In spite of running Tools/scripts/install-prereqs-ubuntu.sh -y (successfully - I think)

I get:

/bin/sh: 1: arm-none-eabi-gcc: not found

When I do the make.

I need to do it for Px4-v2 right?

In any case I am trying to figure out why the arm compiler is not available.

Ben


(Ben Reich) #10

Update - Success I think. I manually installed the arm compiler.

So now I have a file called: ArduCopter-v2.px4

Can you help me running it from a line command or from a python sitl call?


(Khancyr) #11

The px4-v2 is for pixhawk not for simultation.

to build for SITL you need to use
./waf configure
./waf copter

And it should build SITL.


(peterbarker) #12

/bin/sh: 1: arm-none-eabi-gcc: not found

When I do the make.

I need to do it for Px4-v2 right?

Yes, indeed. However, SITL requires binaries compiled for the platform
you’re working on, not an embedded platform!

See @khancyr’s note :slight_smile:

You could actually just start the autotest on the AWS server:
./Tools/autotest/autotest.py --debug build.ArduCopter fly.ArduCopter

(you can add --map to that if you happen to have remote X working)

Or the sim_vehicle.py interface to SITL:
./Tools/autotest/sim_vehicle.py --debug -v ArduCopter

Both of those will leave binaries in build/sitl-debug/bin

… and you know they work that way :slight_smile:

Ben

Yours,


(Ben Reich) #13

Hey Peter. Thanks!

You sent me to his main page. Is there a specific note that I should look for?

In any case… Do I need to rebuild sitl or just the copter. If its the latter - how do I point sitl to the new copter from the command line and from a python script?

I tried the test and this is the result??

ubuntu@ip-172-31-36-30:~/sitl/ardupilot$ ./Tools/autotest/autotest.py --debug build.ArduCopter fly.ArduCopter
Traceback (most recent call last):
** File “./Tools/autotest/autotest.py”, line 18, in **
** import apmrover2**
** File “/home/ubuntu/sitl/ardupilot/Tools/autotest/apmrover2.py”, line 7, in **
** import pexpect**
ImportError: No module named pexpect

The sim_vehicle thing was more successful:

Init APM:Copter V3.6-dev (624aef40)

Free RAM: 131072
FW Ver: 120

Firmware change: erasing EEPROM…
done.
load_all took 0us
0 0 0 validate_structures:209: Validating structures
DataFlash_File: buffer size=16384
online system 1
STABILIZE> Mode STABILIZE
APM: Calibrating barometer
APM: APM:Copter V3.6-dev (624aef40)
APM: Frame: QUAD
Received 887 parameters
Saved 887 parameters to mav.parm
APM: Barometer calibration complete
Init Gyro***

Ready to FLY APM: GPS 1: detected as u-blox at 115200 baud
fence breach
APM: EKF2 IMU0 initial yaw alignment complete
APM: EKF2 IMU1 initial yaw alignment complete
APM: EKF2 IMU0 tilt alignment complete
APM: EKF2 IMU1 tilt alignment complete
APM: EKF2 IMU0 Origin set to GPS
APM: EKF2 IMU1 Origin set to GPS
APM: EKF2 IMU0 is using GPS
APM: EKF2 IMU1 is using GPS
Flight battery 100 percent


So that means I can fly sitl with copter 3.6-dev. right?

How do I do that from a drone-kit sitl command?

How do I do it from Python?

I want to thank you again so much for your help on this.


(peterbarker) #14

In any case… Do I need to rebuild sitl or just the copter. If its the
latter - how do I point sitl to the new copter from the command line and
from a python script?

Depends on the script. But the (master!) dronekit-sitl constructor takes
an argument to specify which binary to use.

This dronekit-python script takes a --binary option:
https://github.com/dronekit/dronekit-python/blob/source-system-filtering/examples/avoidance/avoidance-manytests-plane.py#L26

I tried the test and this is the result??

ubuntu@ip-172-31-36-30:~/sitl/ardupilot$ ./Tools/autotest/autotest.py
–debug build.ArduCopter fly.ArduCopter
Traceback (most recent call last):
** File “./Tools/autotest/autotest.py”, line 18, in **
** import apmrover2**
** File “/home/ubuntu/sitl/ardupilot/Tools/autotest/apmrover2.py”, line 7,
in **
** import pexpect**
ImportError: No module named pexpect

Fix that with either your package manager or pip.

Init APM:Copter V3.6-dev (624aef40)
So that means I can fly sitl with copter 3.6-dev. right?

Yes.

How do I do that from a drone-kit sitl command?

See script mentioned above :slight_smile:

How do I do it from Python?

Ah… dronekit-sitl is Python?!

I want to thank you again so much for your help on this.

No worries :slight_smile:

Peter


(Ben Reich) #15

Hi Peter,

Thanks again for the help. When I start the copter that I built in sitl it fails pre-arm checks. Is it because it is the 3.6? How do I compile ardupilot with copter 3.5 stable? I

Best,

Ben


(peterbarker) #16

Thanks again for the help. When I start the copter that I built in sitl it
fails pre-arm checks. Is it because it is the 3.6? How do I compile
ardupilot with copter 3.5 stable? I

git checkout Copter-3.5

Perhaps if you pasted in the text of the pre-arm failure I could help
diagnose that :slight_smile:

Ben

Peter


Visit Topic or reply to this email to respond.


In Reply To

[45.png]
peterbarker
December 13 In any case… Do I need to rebuild sitl or just the copter. If
its the latter - how do I point sitl to the new copter from the command
line and from a python script? Depends on the script. But the (master!)
dronekit-sitl constructor takes an argument to specify which binary to use.
This drone…


Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

Peter Barker | Programmer,Sysadmin,Geek.
pbarker@barker.dropbear.id.au | You need a bigger hammer.
:: It’s a hack! Expect underscores! - Nigel Williams


(Ben Reich) #17

Hi ,

I took some time off of trying to fly my SITLs in the cloud but I am back at it. I got to a point where I can successfuly build arducopter on an ubuntu server on AWS. I do this with:
./waf configure
./waf copter

I then run sitl and here is the output that I get when I connect to it from a ground station or a script:

APM:Copter V3.6-dev (624aef40)
Frame: UNKNOWN
PreArm: check firmware or FRAME_CLASS
PreArm: 3D Accel calibration needed
PreArm: Compass not calibrated
PreArm: Compass not calibrated
PreArm: RC Roll not configured
PreArm: RC Pitch not configured
PreArm: RC Throttle not configured
PreArm: RC Yaw not configured

Can anyone help with this?

Thanks -

Ben