Linux (Ubuntu) SDK Example Walkthrough.

Parrot SDK, Linux SDK, Java, PC, Mac, scripts for Parrot drones... etc.
alstar
Newcomer
Posts: 2
Joined: 24 Jun 2011, 16:44

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by alstar » 24 Jun 2011, 19:19

[I got it flying on windows vista and 7 but want to get it up on linux too and am not that familiar with linux.]
@sprayin99

Hey,
Im trying to run the A.R.Drone 1.7 sdk on a HP laptop with Windows Vista and I definitely ran into a lot of compiling errors which is preventing me from using this sdk. I was wondering if you could plz help me out with this situation? Maybe like a guide that you followed to make things work. Thanks

fpv-drone
Ready for take off
Posts: 17
Joined: 18 Dec 2010, 23:40

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by fpv-drone » 03 Oct 2011, 05:29

Ubuntu SDK Instructions

For any newcomers... Based on the OP (BTW thanks for getting us started), here is a summary of the instructions:

0.) [Only required the first time you build an SDK] There are some packages required to compile the SDK code.

a) In the Terminal application run the following three commands:
"sudo apt-get install libgtk2.0-dev"
"sudo apt-get install libsdl1.2-dev"
"sudo apt-get install libiw-dev"

1.) Download the SDK.

https://projects.ardrone.org/" onclick="window.open(this.href);return false;

2.) Extract the downloaded "tar.gz" file.

a) I tend to keep the previous SDK versions in case there is a problem with the latest. For example, I have a directory called "ar-drone" which currently contains the following three directories...

"ARDrone_SDK_1_5_Version_20101004"
"ARDrone_SDK_1_6_20110224"
"ARDrone_SDK_Version_1_8_20110726"

... each of which was created by placing the downloaded file in "ar-drone", and then executing "Extract Here" on it.

3.) Set "USE_LINUX=yes" in "custom.makefile".

a) The "custom.makefile" is located in "ARDroneLib/Soft/Build/".

4.) Compile the base SDK.

a) In the Terminal application change directory "cd ARDroneLib/Soft/Build".
b) In the Terminal application run "make" and let it build.
c) Within "ARDroneLib/Soft/Build/" there will now be a "targets_versions" folder with the compiled code.

5.) Compile the navigation example.
- It is the most verbose and has support for a PS3 controller.

a) In the Terminal application change directory to "cd Examples/Linux/Navigation/Build".
b) In the Terminal application run "make" and let it build.

6.) Run "ardrone_navigation", which is located in "Examples/Linux/Build/Release".

7.) [Optional for PS3 gamepad users] Close the application, and insert the following <device> section into the "ardrone.xml" file that is created where you launched "ardrone_navigation" from.

<device id="88867432" name="Sony PLAYSTATION(R)3 Controller" default="yes">
<controls>
<control name="takeoff" value="3" type="3"/>
<control name="emergency" value="0" type="3"/>
<control name="pitch_front" value="-2" type="1"/>
<control name="pitch_back" value="2" type="1"/>
<control name="roll_left" value="-1" type="1"/>
<control name="roll_right" value="1" type="1"/>
<control name="yaw_left" value="-3" type="1"/>
<control name="yaw_right" value="3" type="1"/>
<control name="speed_up" value="-4" type="1"/>
<control name="speed_down" value="4" type="1"/>
</controls>
</device>
Last edited by fpv-drone on 01 May 2012, 00:55, edited 1 time in total.

User avatar
stalker145
Newcomer
Posts: 1
Joined: 19 Oct 2011, 23:30
Location: Jacksonville, NC, USA
Contact:

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by stalker145 » 16 Nov 2011, 19:38

@fpv-drone

Thank you SO much for the how-to. I'd tried the OP's before and gave up after some trying, but your's walked me through without issue.

Now to wait another 40 days to open my Drone for Christmas :cry:

cowmoo32
Battery Charged
Posts: 8
Joined: 04 Jan 2012, 01:44

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by cowmoo32 » 04 Jan 2012, 01:48

Thank you to everyone who has posted the step by step instructions, huge help.


I've run into a problem though: I can't get the drone to launch with either the keyboard or the PS3 controller. When I hit return on the keyboard to launch, the nav program activates whatever menu I have highlighted. And if I try to use the PS3 controller I can't map the buttons; all I get is a -13 on one button and nothing on the others. I know the computer is picking up the controller because it's registering the inputs via jstest.

Has anyone else run into this sort of problem?

cowmoo32
Battery Charged
Posts: 8
Joined: 04 Jan 2012, 01:44

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by cowmoo32 » 09 Jan 2012, 03:31

I finally got the demo working with my PS3 controller, but now I'm having trouble getting it to work with the nav demo. I'm not able to launch with PS3 or keyboard.

ahartline
Battery Charged
Posts: 8
Joined: 18 Dec 2011, 14:47

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by ahartline » 28 Jan 2012, 19:22

cowmoo32 wrote:I finally got the demo working with my PS3 controller, but now I'm having trouble getting it to work with the nav demo. I'm not able to launch with PS3 or keyboard.
Same here.... haven't spent a lot of time tinkering with it yet cuz I'm waiting for the epoxy to dry ;P

progone
Newcomer
Posts: 3
Joined: 21 Feb 2012, 05:59

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by progone » 21 Feb 2012, 06:26

thegogz wrote:
thedinuka wrote:well. Found a solution.

this https://projects.ardrone.org/boards/1/topics/show/2614" onclick="window.open(this.href);return false;

and this https://projects.ardrone.org/boards/1/topics/show/1006" onclick="window.open(this.href);return false;

solved my problem. Apparently you have to "set USE_LINUX=yes in custom.makefile"

Hope I did it in the correct way. Please let me know if you guys think otherwise

thanks
You can modify the custom.makefile but its much easier if you just type 'make USE_LINUX=yes' at the command line. No need for editing this will override the values in the custom.makefile

No luck for me: using 'make USE_LINUX=yes' I have fatal error: libavutil/avutil.h: no such file
sorry my virtual box is having copy and paste issues lately or I'd give you all of the info.

cowmoo32
Battery Charged
Posts: 8
Joined: 04 Jan 2012, 01:44

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by cowmoo32 » 17 Mar 2012, 16:50

Can anyone help me out with the nav demo? Or even the sdk demo? I can't even get the PS3 controller to connect, much less get anything to work via the nav demo.

fpv-drone
Ready for take off
Posts: 17
Joined: 18 Dec 2010, 23:40

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by fpv-drone » 01 May 2012, 01:32

I haven't use my AR.Drone since last summer.

I tried setting up the SDK (v18) within the recently released Ubuntu 12.04, but when I ran "make" in step #4, it reports that the following packages are missing:

Code: Select all

libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavfilter-dev libcwiid1-dev libbluetooth-dev libxml2-dev libudev-dev

Package libcwiid1-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However, the following packages replace it:
  libcwiid-dev

E: Package 'libcwiid1-dev' has no installation candidate
Building ARDroneTool/Lib
cc video_codec.c
In file included from ../../VLIB/../VLIB/video_controller.h:5:0,
                 from ../../VLIB/../VLIB/video_codec.h:4,
                 from ../../VLIB/video_codec.c:1:
../VP_Api/vp_api_picture.h:16:30: fatal error: libavutil/avutil.h: No such file or directory
compilation terminated.
make[4]: *** [../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_3.2.0-24-generic-pae_GNU_Linux_gcc_4.6.3/video_codec.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [build_vlib] Error 2
make[1]: *** [all] Error 2
make: *** [build_libs] Error 2
I found this suggestion online, but it didn't work: Replace the line 39 in (SDK)/ARDroneLib/Soft/Build/check_dependencies.sh with the correct version of the package, i.e. "libcwiid1-dev" -> "libcwiid-dev".

For now, I decided to setup a dual-boot on my netbook: (1) Lubuntu 12.04 for day-to-day use, and (2) Ubuntu 10.10 for AR.Drone use.

The setup steps above still work with Ubuntu 10.10.

fpv-drone
Ready for take off
Posts: 17
Joined: 18 Dec 2010, 23:40

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by fpv-drone » 03 Jul 2012, 01:58

With SDK version 2.0, I followed the steps above, on a Lenovo S10-3t netbook, with Lubuntu 12.04 (with latest updates).

During step #4 (Compile the base SDK), I was prompted to install two additional packages:
- libxml2-dev
- libudev-dev

Otherwise, the process worked fine.

The new Linux navigation example looks pretty much the same as the previous version, except it contains additional UI interface elements for the new features of the new drone. For example, there is a button for starting and stopping the video recording to the on-board USB flash drive.

One difference that had me concerned at first is that unlike the previous versions, the Linux navigation application does not open unless the computer is connected to the AR.drone's WiFi network.

Unfortunately, I was unable to get the PS3 gamepad to work with the Linux example, nor was I able to even take off using the default "Keyboard" controls.

So far I haven't been able to get the previous method of manually adding the PS3 gamepad controller configuration to the "ardrone.xml" file to work. The navigation application has a section for selecting an input method, either Keyboard (which is preconfigured) or PS3 Controller (which has all values defaulted to "0"). This section also provides options for reconfiguring the input method. However, I was unable to get this to work for the PS3 gamepad.

I ran out of time today to troubleshoot the remaining issues. I'll check in again when I have a chance to figure it out. If you know how to overcome these issues, please post here.

aen3
Ready for take off
Posts: 32
Joined: 29 Dec 2011, 04:32

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by aen3 » 27 Aug 2012, 21:51

fpv-drone wrote:With SDK version 2.0, I followed the steps above, on a Lenovo S10-3t netbook, with Lubuntu 12.04 (with latest updates).

During step #4 (Compile the base SDK), I was prompted to install two additional packages:
- libxml2-dev
- libudev-dev

Otherwise, the process worked fine.

The new Linux navigation example looks pretty much the same as the previous version, except it contains additional UI interface elements for the new features of the new drone. For example, there is a button for starting and stopping the video recording to the on-board USB flash drive.

One difference that had me concerned at first is that unlike the previous versions, the Linux navigation application does not open unless the computer is connected to the AR.drone's WiFi network.

Unfortunately, I was unable to get the PS3 gamepad to work with the Linux example, nor was I able to even take off using the default "Keyboard" controls.

So far I haven't been able to get the previous method of manually adding the PS3 gamepad controller configuration to the "ardrone.xml" file to work. The navigation application has a section for selecting an input method, either Keyboard (which is preconfigured) or PS3 Controller (which has all values defaulted to "0"). This section also provides options for reconfiguring the input method. However, I was unable to get this to work for the PS3 gamepad.

I ran out of time today to troubleshoot the remaining issues. I'll check in again when I have a chance to figure it out. If you know how to overcome these issues, please post here.
The keyboard will not work (that is stated in the SDK documentation). However, your PS3 controller should with the following instructions. The process I used to setup my logitech 3d pro joystick is as follows:

1. Launch ardrone_navigation with your controller plugged in.

2. Click "Input Configuration" then "USB Configuration"

3. You should see your controlller in the drop down. Select it, hit ok, and close the application (if it is not in the dropdown then it is not recognized by the computer and you might need to install drivers or get a different controller)

4. Go into terminal and type

Code: Select all

sudo apt-get install joystick
(you need internet)

5. run

Code: Select all

jstest /dev/input/js0
(if that doesnt work try js1 or js2)

6. Manipulate each axis (both directions) and button you wish to use to control the drone and record the number before the colon as well as whether the number after it is negative (up/left was negative for me). You can also do

Code: Select all

jscal -c /dev/input/js0
to calibrate your controller but that could mess it up if its already calibrated well.

7. right click the ardrone.xml file and open with text edit. You should see your device at the bottom. Replace the values with those from jstest with the negative in front if the corresponding angle value was negative. Set the types to 1 if axis and 3 if button. Save and Close.

8. Restart your computer and try to control your drone. If that doesn't work restart again. If it still doesn't work check the values in the xml file.

I hope this helps or you already figured it out!

cowmoo32
Battery Charged
Posts: 8
Joined: 04 Jan 2012, 01:44

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by cowmoo32 » 14 Sep 2012, 02:52

I recently updated to 12.04 and I'm trying to get everything compiled but I'm running into some weird errors. Any ideas?

Code: Select all

$ make
sh ./check_dependencies.sh
Checking required Ubuntu packages ...
ok.
Building ARDroneTool/Lib
cc video_codec.c
In file included from ../../VLIB/../VLIB/video_controller.h:5:0,
                 from ../../VLIB/../VLIB/video_codec.h:4,
                 from ../../VLIB/video_codec.c:1:
../VP_Api/vp_api_picture.h:118:20: error: field ‘format’ has incomplete type
make[4]: *** [../../Soft/Build/targets_versions/ffmpeg_Intel_PROD_MODE_Linux_3.2.0-29-generic_GNU_Linux_gcc_4.6.3/video_codec.o] Error 1
make[3]: *** [all] Error 2
make[2]: *** [build_vlib] Error 2
make[1]: *** [all] Error 2
make: *** [build_libs] Error 2


3nslav3
Batterys getting low
Posts: 908
Joined: 27 Jan 2012, 13:34
Drone Type: AR.Drone 2

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by 3nslav3 » 03 Oct 2012, 13:36

same here, I'm a linux noob :P

it wont run at all on ubuntu 12.04 :(

I do have the "ardrone_navigation" thing in the release folder but i can't run it (i gues clicking it should do it in the filebrowser but nothing happens -_-) i feel like an idiot

but i did manage to do all the commands etc :D thank god this shit looks a bit like the good old DOS days :P


if anyone knows a solution I'd be very greatful :)

fpv-drone
Ready for take off
Posts: 17
Joined: 18 Dec 2010, 23:40

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by fpv-drone » 09 Jan 2013, 23:16

Thanks for the help and instructions.

I followed the steps, but in the end they allowed me realize that the new sdk example application (2.0) uses an "ardrone.xml" file that is located in the "/home/[linux_user_name]/" folder instead of the run folder like previous versions (1.8 and older).

On a side note, the jstest utility does not work until you press the PS3's "PS" button, even though the gamepad's status lights are on already. Also, the axis information I collected from this utility did not match the ps3 numbers I had from the previous XML file.

In the end, as I said above, it was only a matter of putting the existing ps3 device code in the correct XML file.

Thanks for inspiring me to take another look at it, and finally getting it to work.

aen3 wrote:
fpv-drone wrote:With SDK version 2.0, I followed the steps above, on a Lenovo S10-3t netbook, with Lubuntu 12.04 (with latest updates).

During step #4 (Compile the base SDK), I was prompted to install two additional packages:
- libxml2-dev
- libudev-dev

Otherwise, the process worked fine.

The new Linux navigation example looks pretty much the same as the previous version, except it contains additional UI interface elements for the new features of the new drone. For example, there is a button for starting and stopping the video recording to the on-board USB flash drive.

One difference that had me concerned at first is that unlike the previous versions, the Linux navigation application does not open unless the computer is connected to the AR.drone's WiFi network.

Unfortunately, I was unable to get the PS3 gamepad to work with the Linux example, nor was I able to even take off using the default "Keyboard" controls.

So far I haven't been able to get the previous method of manually adding the PS3 gamepad controller configuration to the "ardrone.xml" file to work. The navigation application has a section for selecting an input method, either Keyboard (which is preconfigured) or PS3 Controller (which has all values defaulted to "0"). This section also provides options for reconfiguring the input method. However, I was unable to get this to work for the PS3 gamepad.

I ran out of time today to troubleshoot the remaining issues. I'll check in again when I have a chance to figure it out. If you know how to overcome these issues, please post here.
The keyboard will not work (that is stated in the SDK documentation). However, your PS3 controller should with the following instructions. The process I used to setup my logitech 3d pro joystick is as follows:

1. Launch ardrone_navigation with your controller plugged in.

2. Click "Input Configuration" then "USB Configuration"

3. You should see your controlller in the drop down. Select it, hit ok, and close the application (if it is not in the dropdown then it is not recognized by the computer and you might need to install drivers or get a different controller)

4. Go into terminal and type

Code: Select all

sudo apt-get install joystick
(you need internet)

5. run

Code: Select all

jstest /dev/input/js0
(if that doesnt work try js1 or js2)

6. Manipulate each axis (both directions) and button you wish to use to control the drone and record the number before the colon as well as whether the number after it is negative (up/left was negative for me). You can also do

Code: Select all

jscal -c /dev/input/js0
to calibrate your controller but that could mess it up if its already calibrated well.

7. right click the ardrone.xml file and open with text edit. You should see your device at the bottom. Replace the values with those from jstest with the negative in front if the corresponding angle value was negative. Set the types to 1 if axis and 3 if button. Save and Close.

8. Restart your computer and try to control your drone. If that doesn't work restart again. If it still doesn't work check the values in the xml file.

I hope this helps or you already figured it out!

fpv-drone
Ready for take off
Posts: 17
Joined: 18 Dec 2010, 23:40

Re: Linux (Ubuntu) SDK Example Walkthrough.

Post by fpv-drone » 30 Jun 2013, 00:17

Ubuntu SDK Instructions

Hardware and software details
  • AR.Drone: 2.0
  • Laptop: Lenovo X131e
  • OS: Ubuntu 13.04
  • AR.Drone SDK: 2.0
For any newcomers... Based on the OP (BTW thanks for getting us started), here is a summary of the instructions:

0.) [Only required the first time you build an SDK] There are some packages required to compile the SDK code.

a) In the Terminal application run the following six commands:

Code: Select all

sudo apt-get install libgtk2.0-dev
sudo apt-get install libsdl1.2-dev
sudo apt-get install libiw-dev
sudo apt-get install libxml2-dev
sudo apt-get install libudev-dev
sudo apt-get install libncurses5-dev libncursesw5-dev
The libncurses* packages solve the "fatal error: curses.h: No such file or directory" compilation error.

1.) Download the SDK.

https://projects.ardrone.org/" onclick="window.open(this.href);return false;

2.) Extract the downloaded "tar.gz" file.

Right-click on the "ARDrone_SDK_2_0.tar.gz" file, and select the "Extract Here" command.

3.) Set "USE_LINUX=yes" in "custom.makefile".

a) Navigate to the "ARDroneLib/Soft/Build/" folder.

b) Open the "custom.makefile" file.

c) Find and change the following statement from ...

Code: Select all

USE_LINUX=no
... to ...

Code: Select all

USE_LINUX=yes
4.) Compile the base SDK.

a) In the Terminal application go to the "ARDroneLib/Soft/Build/" folder.

Code: Select all

cd ARDroneLib/Soft/Build
b) In the Terminal application run "make" and let it build.

Code: Select all

make
c) Within the "ARDroneLib/Soft/Build/" folder there will now be a "targets_versions" folder with the compiled code.

5.) Compile the navigation example.
- It is the most verbose and has support for a PS3 controller.

a) Add the following statement to the 159th line (or above) of "Makefile", which is located in the "Examples/Linux/Navigation/Build/" folder.

Code: Select all

GENERIC_LIBS+= -lm
- Thank you, Sreekanth from https://projects.ardrone.org/boards/1/topics/show/5740" onclick="window.open(this.href);return false;
- This resolves the "libm.so.6: could not read symbols: Invalid operation" compilation error.

b) In the Terminal application go to the "Examples/Linux/Navigation/Build/ folder.

Code: Select all

cd Examples/Linux/Navigation/Build
c) In the Terminal application run "make" and let it build.

Code: Select all

make
6.) Establish the wireless connection between the AR.Drone and the laptop.

NOTE: If the AR.Drone is not communicating with the laptop, and you launch the "ardrone_navigation" executable, the UI window does not open. However, the application is running in the background. Once this occurs, the only way to exit the application is to either reboot the computer or kill the process from the System Monitor. (I believe the presence of one or more of these dangling "ardrone_navigation" executables can adversely affect things later on even after successfully completely this step).

a) Power on the AR.Drone by connecting its battery.
- I recommend attaching the indoor cover to protect the props at least during the first few attempts to connect and use the software.

b) Enable WiFi on the computer.
- Sometimes Ubuntu severely limits the wireless data-rate if the computer is running off battery power. The current workaround is to disable this powersaving feature with the following command.

Code: Select all

sudo iwconfig wlan0 power off
c) Connect the computer to the AR.Drone's wireless hotspot.

7.) Run "ardrone_navigation".

a) Navigate to the "Examples/Linux/Build/Release/" folder.

b) Double-click the "ardrone_navigation" file.

8.) [Optional for PS3 gamepad users] Add PS3 gamepad support.

a) Close the application.

b) Navigate to and open the "ardrone.xml" file that is created where you launched "ardrone_navigation" from.

c) Insert the following <device> section, while adhering to file's XML framework.

Code: Select all

    <device id="88867432" name="Sony PLAYSTATION(R)3 Controller" default="yes">
      <controls>
        <control name="takeoff" value="3" type="3"/>
        <control name="emergency" value="0" type="3"/>
        <control name="pitch_front" value="-2" type="1"/>
        <control name="pitch_back" value="2" type="1"/>
        <control name="roll_left" value="-1" type="1"/>
        <control name="roll_right" value="1" type="1"/>
        <control name="yaw_left" value="-3" type="1"/>
        <control name="yaw_right" value="3" type="1"/>
        <control name="speed_up" value="-4" type="1"/>
        <control name="speed_down" value="4" type="1"/>
      </controls>
    </device>

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests