Difference between revisions of "Paul Cox Notes"

From PaparazziUAV
Jump to navigation Jump to search
 
 
(76 intermediate revisions by 3 users not shown)
Line 1: Line 1:
work in progress:
= LISTS =


==Links==
{| class="wikitable" style="text-align:center;background:black; color:blue"
|+ Paul's Links
|-
! 1 !! 2 !! 3 !! 4 !! 5
|- style="background:bisque; color:black"
|[[Community_Flight_Log_Archive]]
||
[[Paul_Cox_Activity_Log]]
||
[[User:PaulCox]]
||
[[Lisa_Logitech_Camera]]
||
[[Rt3070usb]]
|- style="background:bisque; color:black"
[[http://paparazzi.enac.fr/wiki/Qwip]]
||
[[ArduIMU]]
||
[[Laserhawk]]
||
x
||
x
||
x
|}


Getting Started in Paparazzi
==TODO==
Paul Cox Nov 2008
{| class="wikitable" style="text-align:center;background:black; color:blue"
|+ SPRING 2011 TODO LIST
|-
! Num !! Name !! Notes !! Priority !! Status


Installing Software on Ubuntu Intrepid Ibex 8.10
|- style="background:lemonchiffon; color:black"
| 1 || build virtual world scan in hoku2gdhe || x || x || In progress
|- style="background:bisque; color:black"
| 2 || Install MTi-G driver on laptop || MTIHardTest -v <params> >> out.txt stores to disk || x || Done
|- style="background:bisque; color:black"
| 3 || Get test scans from rooftop || one night scan acquired. need day scans and higher scans (and faster) || x || In progress
|- style="background:bisque; color:black"
| 4 || Design MIPI/I2C camera board || sketches ready, Pierre doing orcad and ordering || x || In progress
|- style="background:bisque; color:black"
| 5 || Design/Build hokuyo/MTIG box/mounting cage || Build at Bertrand's place or ENAC || x || Not started
|- style="background:bisque; color:black"
| 6 || Get openembedded running on laptop || laptop too slow || x || Waiting for new PC
|- style="background:bisque; color:black"
| x ||x || x || x || x
|}


Used CVS to download "paparazzi3". also discovered Booz guys are using svn and that repository is called "paparazzi4"
==PERSO TODO==
{| class="wikitable" style="text-align:center;background:black; color:blue"
|+ PERSONAL TODO LIST
|-
! Num !! Name !! Notes !! Priority !! Status
|- style="background:bisque; color:black"
| 1 || Get minimag flying || tuneup done, need some glue then ready for maiden || [[User:Paulcox|Paulcox]] 10:33, 17 February 2011 (CET) || In progress
|- style="background:bisque; color:black"
| 2 || Slowstick flying || First arduimu flights done, issues due to auto2 probably due to flight plan altitues, need to study logs || x || In progress
|- style="background:bisque; color:black"
| 3 || Flash ardupimu and get ap compiling || methodology posted on [[ArduIMU]] page || x || Done
|- style="background:bisque; color:black"
| 4 || Test xbeepro868 performance || XCTU loopback at 9600 shows 80-90%, with basic telemetry was seeing huge (10-15 sec) delay (was looking at attitude messages), short flights at 57600 ok so far|| x || In progress
|- style="background:bisque; color:black"
| 5 || Test loss of IR contrast || works in simulation, need to test in real || x || In progress
|- style="background:bisque; color:black"
| 6 || Adjust Beth opamp gains || for increased precision || x || Do it slacker
|- style="background:bisque; color:black"
| 7 || Try Web-based GCS || qwip checked in, need to try pow ||| x || In progress
|- style="background:bisque; color:black"
| 8 || Improve altitude control loop || issue with hard boundary between PI and constant regions || x || x
|- style="background:bisque; color:black"
| 9 || Some camera stabilization || Read gimbal servo positions via pot tap to ADC || x || x
|- style="background:bisque; color:black"
| 10 || Try then document item drop capability || one of the checked in enac flight plans does this || x || not started
|- style="background:bisque; color:black"
| 11 || Paparazzi Documentation || Started outlining [http://paparazzi.enac.fr/wiki/Documentation_Needed here] || x || Stalled
|- style="background:bisque; color:black"
| 12 || try pan/tilt code || x || x || no started
|- style="background:bisque; color:black"
| 13 || get log archive ready || x || x || In progress
|- style="background:bisque; color:black"
| 14 || redo joystick control setup || look at chris' stuff he send || x || Not started
|- style="background:bisque; color:black"
| 15 || potentially merge tiny/overo i2c com code from tobias || x || x || In progress
|}


Read the wiki multiple times through, built everything acording to instructions, and fired off the program which seems to run in simulator mode, although
==BUY BUY BUY==
{| class="wikitable" style="text-align:center;background:black; color:blue"
|+ WISH LIST
|-
! Num !! Name !! Notes !! Price !! Status
|- style="background:bisque; color:black"
| 1 || RC Transmitter (PPM and 2.4GHz) || x || x || x
|- style="background:bisque; color:black"
| 2 || Overo Camera || x || x || x
|- style="background:bisque; color:black"
| 3 || Lisa board || x || x || x
|- style="background:bisque; color:black"
| 4 || I2C motor controllers  || need 4 to finish quad || x || x
|- style="background:bisque; color:black"
| 5 || New laptop || x || x || Keep dreaming
|- style="background:bisque; color:black"
| 6 || XBeePro868 || Need a third one to test point to multi-point || x || x
|- style="background:bisque; color:black"
| 7 || RazorIMU || For testing || x || x
|- style="background:bisque; color:black"
| 8 || Minimag || x || x || x
|- style="background:bisque; color:black"
| 9 || x || x || x || x
|}


I'm currently not seeing any action when I hit the "Launch" button. I probably haven't read something important somewhere...
==IDEAS==
{| class="wikitable" style="text-align:center;background:black; color:blue"
|+ IDEA LIST
|-
! Num !! Name !! Notes !! Priority !! Status
|- style="background:bisque; color:black"
| 1 || x || x || x || x
|- style="background:bisque; color:black"
| 2 || x || x || x || x
|- style="background:bisque; color:black"
| 3 || x || x || x || x
|}


Gather hardware:
=Random Notes=


Looked at the hardware designs in CVS to see if I wanted to customize a design or build one of the "released" designs. In summary, the current things
== ubuntu packages ==


folks are building and using are:
===Utilities===
<pre>
sudo apt-get install medit gtkterm git-core ssh apt-file vim
</pre>


Autopilots
===paparazzi===
<pre>
sudo apt-get install paparazzi-dev paparazzi-stm32 paparazzi-arm7 paparazzi-omap  libmpfr1ldbl
</pre>


--) Tiny 1.3  - ARM processor and GPS on 4 layer PCB with 0402. Benefits: smaller and 4 layers is more reliable Drawbacks: Design is older and has
===perl modules===
<pre>
sudo apt-get install libstatistics-descriptive-perl libgd-gd2-perl libgeo-coordinates-utm-perl \
  libhtml-template-perl libxml-twig-perl libdigest-hmac-perl libdigest-sha1-perl libdigest-md5-file-perl
  wget http://search.cpan.org/CPAN/authors/id/M/MA/MAHEX/Image-Grab-1.4.2.tar.gz
</pre>


evolved so there are some missing feature and maybe some issues (Insert more specifics here as I learn them)
===CGI webserver===
--) Tiny 2.11 - ARM processor and GPS on 2 layer PCB with 0603 SMT devices.
<pre>
--) TWOG - Tiny 2.11 without GPS. I assume people want to branch out and use different GPS and not just the u-blox stuff. Also I see mention that
sudo apt-get install boa
</pre>


some people want to mount GPS hardware some place different on their airframe than where the autopilot resides.
===openrobots===
--) Booz - Some very exciting quadrotor developments. HW Design not checked yet as there's some errata that someone feels like needs to be fixed
<pre>
sudo apt-get install libbz2-dev pax cmake automake autoconf doxygen libgl1-mesa-dev \
  libglu1-mesa-dev tcl-dev tk-dev libjpeg-dev libxpm-dev swig libxmu-dev libxt-dev libxt6 libxt-dev \
  tcl-dev tk-dev libbz2-dev freeglut3-dev qtcreator libtiff-dev libraw1394-dev libeigen2-dev libdc1394-22-dev
</pre>


before it is commited.
Create file ~/.ssh/config
<pre>
Host *.laas.fr
User pdcox
</pre>


Sensors
==Using a joystick to control twog servo==
===PC-side configuration===


--) Single Axis IR - For two Melexis thermopiles
On the PC side we will send actuator commands two different ways:
--) Dual Axis IR - For four Melexis thermopiles
--) GPS board - A PCB to hold just a GPS and an antenna. For use with TWOG


: 1. Running an ocaml application that listens to the joystick device and using a configuration file, will send ivy messages that get forwarded to the vehicle by the server.
: 2. Normal paparazzi settings mechanism (using settings dialog from paparazzi center running on PC) that sets corresponding variables on the vehicle.


Running the joystick test program you can see which buttons do what:
(Note you have to run a make in the directory first to compile everything)


Looked at how much to have the PCBs fab'ed by quick turn board house, but unless you order 25 or more PCBs you're better off buying from the listed
<pre>
~/paparazzi3/trunk/sw/ground_segment/joystick$ ./test_stick
Available button: 288 (0x120)
Available button: 289 (0x121)
Available button: 290 (0x122)
Available button: 291 (0x123)
Available button: 292 (0x124)
Available button: 293 (0x125)
Available button: 294 (0x126)
Available button: 295 (0x127)
Available button: 296 (0x128)
Available button: 297 (0x129)
Available button: 298 (0x12a)
Available button: 299 (0x12b)
Available axis: 0 (0x0)
Available axis: 1 (0x1)
Available axis: 2 (0x2)
Available axis: 5 (0x5)
Available axis: 16 (0x10)
Available axis: 17 (0x11)
Available axis: 40 (0x28)
Axis 0 : parameters = [0,255]
Axis 1 : parameters = [0,255]
Axis 2 : parameters = [0,255]
Axis 3 : parameters = [0,255]
Axis 4 : parameters = [-1,1]
Axis 5 : parameters = [-1,1]
Axis 6 : parameters = [0,255]
Input device name: "GreenAsia Inc.    USB Joystick    " on device "/dev/input/event6"
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 127 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 87 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 20 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 69 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 127 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 127 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 111 48 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 127 -64 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 -127 32 -127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 -127 -39 -69 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 -117 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 -127 127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 40 -35 127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 49 127 127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 127 127 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -53 127 127 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 8 127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 127 84 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 -66 0 0 0 0 127 0 0 0
buttons 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 0 0 0 0 0 127 0 0 0
buttons 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 127 0 0 0 0 127 0 0 0
buttons 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 | axis 47 127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 59 127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -105 -127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -78 -127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 -99 0 0 0 0 127 0 0 0
buttons 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
</pre>


vendors. I went with PPZUAV:  
Then creating an xml configuration file such as:


single IR PCB $8
paul@ledelle:~/paparazzi3/trunk/sw/ground_segment/joystick$ medit ngs_set_actuators.xml
Dual IR PCB $8
Tiny 1.3 PCB $9.95
Tiny 2.11 PCB $5


$6.80 shipping (California to Washington)
and now running the input2ivy ocaml application:


I check first to make sure all was in stock, and David replied that it was. Order took a couple days to process and a few days for the post office to
export PAPARAZZI_HOME=/home/paul/paparazzi3/trunk
paparazzi3/trunk/sz/ground_segment/joystick/input2ivy -ac TJOVERO ngs_set_actuators.xml


deliver the priority lettter. PCBs arrived in a little padded envelope and even though I knew the dimensions before, I was surprised at how small they
running ivyprobe we can see the message getting transmitted:
paul@ledelle:~/paparazzi3/trunk/sw/ground_segment/joystick$ ivyprobe '(.*)'
shows:
Paparazzi joystick sent  'input2ivy SET_ACTUATOR 1496 2 3'


are in the flesh.
but we have to make sure the server knows this message needs to be forwarded: in messages.xml the message should be labeled as "forwarded" :
<pre>
<message name="SET_ACTUATOR" id="100" link="forwarded">
  <field name="value" type="uint16"/>
  <field name="no" type="uint8"/>
  <field name="ac_id" type="uint8"/>
</message>
</pre>


Components were mostly from Digikey:
To send settings use the actuators.xml file:
TI DC/DC was only available in SMT and no shotkys.
<pre>
<settings>
    <dl_settings NAME="Actuators" >
      <dl_setting VAR="actuators[1]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan1"/>
      <dl_setting VAR="actuators[2]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan2"/>
      <dl_setting VAR="actuators[3]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan3"/>
      <dl_setting VAR="actuators[4]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan4"/>
      <dl_setting VAR="actuators[5]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan5"/>
      <dl_setting VAR="actuators[6]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan6"/>
      <dl_setting VAR="actuators[7]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan7"/>
    </dl_settings>
</settings>
</pre>


Complete List:
===Vehicle-side configuration===
(insert spreadsheet here)


Mouser had the switching DC/DC in through-hole and shotky diode so put in an order with them as well:
On the vehicle side we are using a twog for hardware so we will use the setup_actuators target found in  /conf/autopilot/setup.makefile.
This makefile is used by the tiny.makefile which is used because we specify we're using the twog in twinjet_overo.xml


Of note: Looked for GPS modules and antenna and found some items of interest. A Tyco GPS module with a built in antenna for $60 <>. Also antenna <>.
<pre>
  <firmware name="fixedwing">
    <target name="ap" board="twog_1">
</pre>


Different center frequencies are available 1575 and 1579, but googling seems to show that 1575 is the main GPS freq. Not sure what 1579 is useful for,
The setup target is defined as follows in the airframe (twinjet_overo.xml):
<pre>
  <firmware name="setup">
    <target name="tunnel" board="twog_1" />
    <target name="setup_actuators" board="twog_1" />
  </firmware>
</pre>


but it kinda looks like the one paparazzi recommends from their testing is centered at 1579 so I must be missing something.
If we were adding the joystick to the autopilot code we could instead add the following line to the firmware section:
: <subsystem name="joystick"/>
but that's another project...


Complete List:
Here's the setup.makefile section that worked for me:
(insert spreadsheet here)


While waiting for all the hw to arrive, built a wireless GPS device:
<pre>
setup_actuators.CFLAGS += -DFBW -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017
setup_actuators.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DDOWNLINK_DEVICE=Uart1 -DPPRZ_UART=Uart1
setup_actuators.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ
setup_actuators.CFLAGS += -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1
setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c downlink.c actuators.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4017_hw.c main.c
</pre>


Main components:
[[Category:User_Notes]]
 
Wireless modem: XBee Pro 802.15.4 (XBP-24-AUI)
GPS:
Battery: 2S Lipo (gutted Axim x50v battery, rewired from parallel to series)
Antenna: Some rpsma? wifi antenna I had laying around with a u.fl connector/pigtail.
 
Other components
TI DC/DC converter (same as used on tiny)
100uF tantalum capacitor (TI DC/DC conv requires this on the input)
SPDT toggle switch
Samtec mating connector for GPS
kynar wire
plastic box and some thin model plywood for a case
 
Receiver is another XBee Pro in a USB carrier board. The XBee Pro has a wire antenna (XBP-24-?UI). Looking back I should have ordered with the RP-SMA so
 
I can put some coax on there to a big honkin' antenna to improve range.
 
Build process:
Main obstacle here is the fine pitch connector on the GPS module.
 
XBee Pro and the GPS module are 3.3V devices. For the TI DC/DC used on Tiny to produce 3.3V a 1.87kOhm resistor is needed an input capacitor of 100uF is
 
needed. I wired up all these components
 
Bring up process:

Latest revision as of 02:05, 6 April 2011

LISTS

Links

[[1]]
Paul's Links
1 2 3 4 5
Community_Flight_Log_Archive

Paul_Cox_Activity_Log

User:PaulCox

Lisa_Logitech_Camera

Rt3070usb

ArduIMU

Laserhawk

x

x

x

TODO

SPRING 2011 TODO LIST
Num Name Notes Priority Status
1 build virtual world scan in hoku2gdhe x x In progress
2 Install MTi-G driver on laptop MTIHardTest -v <params> >> out.txt stores to disk x Done
3 Get test scans from rooftop one night scan acquired. need day scans and higher scans (and faster) x In progress
4 Design MIPI/I2C camera board sketches ready, Pierre doing orcad and ordering x In progress
5 Design/Build hokuyo/MTIG box/mounting cage Build at Bertrand's place or ENAC x Not started
6 Get openembedded running on laptop laptop too slow x Waiting for new PC
x x x x x

PERSO TODO

PERSONAL TODO LIST
Num Name Notes Priority Status
1 Get minimag flying tuneup done, need some glue then ready for maiden Paulcox 10:33, 17 February 2011 (CET) In progress
2 Slowstick flying First arduimu flights done, issues due to auto2 probably due to flight plan altitues, need to study logs x In progress
3 Flash ardupimu and get ap compiling methodology posted on ArduIMU page x Done
4 Test xbeepro868 performance XCTU loopback at 9600 shows 80-90%, with basic telemetry was seeing huge (10-15 sec) delay (was looking at attitude messages), short flights at 57600 ok so far x In progress
5 Test loss of IR contrast works in simulation, need to test in real x In progress
6 Adjust Beth opamp gains for increased precision x Do it slacker
7 Try Web-based GCS qwip checked in, need to try pow x In progress
8 Improve altitude control loop issue with hard boundary between PI and constant regions x x
9 Some camera stabilization Read gimbal servo positions via pot tap to ADC x x
10 Try then document item drop capability one of the checked in enac flight plans does this x not started
11 Paparazzi Documentation Started outlining here x Stalled
12 try pan/tilt code x x no started
13 get log archive ready x x In progress
14 redo joystick control setup look at chris' stuff he send x Not started
15 potentially merge tiny/overo i2c com code from tobias x x In progress

BUY BUY BUY

WISH LIST
Num Name Notes Price Status
1 RC Transmitter (PPM and 2.4GHz) x x x
2 Overo Camera x x x
3 Lisa board x x x
4 I2C motor controllers need 4 to finish quad x x
5 New laptop x x Keep dreaming
6 XBeePro868 Need a third one to test point to multi-point x x
7 RazorIMU For testing x x
8 Minimag x x x
9 x x x x

IDEAS

IDEA LIST
Num Name Notes Priority Status
1 x x x x
2 x x x x
3 x x x x

Random Notes

ubuntu packages

Utilities

sudo apt-get install medit gtkterm git-core ssh apt-file vim

paparazzi

sudo apt-get install paparazzi-dev paparazzi-stm32 paparazzi-arm7 paparazzi-omap  libmpfr1ldbl

perl modules

sudo apt-get install libstatistics-descriptive-perl libgd-gd2-perl libgeo-coordinates-utm-perl \
  libhtml-template-perl libxml-twig-perl libdigest-hmac-perl libdigest-sha1-perl libdigest-md5-file-perl
  wget http://search.cpan.org/CPAN/authors/id/M/MA/MAHEX/Image-Grab-1.4.2.tar.gz

CGI webserver

sudo apt-get install boa 

openrobots

sudo apt-get install libbz2-dev pax cmake automake autoconf doxygen libgl1-mesa-dev \
  libglu1-mesa-dev tcl-dev tk-dev libjpeg-dev libxpm-dev swig libxmu-dev libxt-dev libxt6 libxt-dev \
  tcl-dev tk-dev libbz2-dev freeglut3-dev qtcreator libtiff-dev libraw1394-dev libeigen2-dev libdc1394-22-dev

Create file ~/.ssh/config

Host *.laas.fr
User pdcox

Using a joystick to control twog servo

PC-side configuration

On the PC side we will send actuator commands two different ways:

1. Running an ocaml application that listens to the joystick device and using a configuration file, will send ivy messages that get forwarded to the vehicle by the server.
2. Normal paparazzi settings mechanism (using settings dialog from paparazzi center running on PC) that sets corresponding variables on the vehicle.

Running the joystick test program you can see which buttons do what: (Note you have to run a make in the directory first to compile everything)

~/paparazzi3/trunk/sw/ground_segment/joystick$ ./test_stick 
Available button: 288 (0x120)
Available button: 289 (0x121)
Available button: 290 (0x122)
Available button: 291 (0x123)
Available button: 292 (0x124)
Available button: 293 (0x125)
Available button: 294 (0x126)
Available button: 295 (0x127)
Available button: 296 (0x128)
Available button: 297 (0x129)
Available button: 298 (0x12a)
Available button: 299 (0x12b)
Available axis: 0 (0x0)
Available axis: 1 (0x1)
Available axis: 2 (0x2)
Available axis: 5 (0x5)
Available axis: 16 (0x10)
Available axis: 17 (0x11)
Available axis: 40 (0x28)
Axis 0 : parameters = [0,255]
Axis 1 : parameters = [0,255]
Axis 2 : parameters = [0,255]
Axis 3 : parameters = [0,255]
Axis 4 : parameters = [-1,1]
Axis 5 : parameters = [-1,1]
Axis 6 : parameters = [0,255]
Input device name: "GreenAsia Inc.    USB Joystick     " on device "/dev/input/event6"
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 127 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 87 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 20 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 69 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 127 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 127 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 111 48 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 127 -64 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 -127 32 -127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 -127 -39 -69 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 -117 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 -127 127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 40 -35 127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 49 127 127 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 127 127 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -53 127 127 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 8 127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 127 84 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 -66 0 0 0 0 127 0 0 0
buttons 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 | axis -127 0 0 0 0 0 127 0 0 0
buttons 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 127 0 0 0 0 127 0 0 0
buttons 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 | axis 47 127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 59 127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -105 -127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis -78 -127 0 0 0 0 127 0 0 0
buttons 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 -99 0 0 0 0 127 0 0 0
buttons 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | axis 0 0 0 0 0 0 127 0 0 0

Then creating an xml configuration file such as:

paul@ledelle:~/paparazzi3/trunk/sw/ground_segment/joystick$ medit ngs_set_actuators.xml

and now running the input2ivy ocaml application:

export PAPARAZZI_HOME=/home/paul/paparazzi3/trunk
paparazzi3/trunk/sz/ground_segment/joystick/input2ivy -ac TJOVERO ngs_set_actuators.xml

running ivyprobe we can see the message getting transmitted:

paul@ledelle:~/paparazzi3/trunk/sw/ground_segment/joystick$ ivyprobe '(.*)'

shows:

Paparazzi joystick sent  'input2ivy SET_ACTUATOR 1496 2 3'

but we have to make sure the server knows this message needs to be forwarded: in messages.xml the message should be labeled as "forwarded" :

 <message name="SET_ACTUATOR" id="100" link="forwarded">
   <field name="value" type="uint16"/>
   <field name="no" type="uint8"/>
   <field name="ac_id" type="uint8"/>
 </message>

To send settings use the actuators.xml file:

<settings>
    <dl_settings NAME="Actuators" >
      <dl_setting VAR="actuators[1]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan1"/>
      <dl_setting VAR="actuators[2]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan2"/>
      <dl_setting VAR="actuators[3]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan3"/>
      <dl_setting VAR="actuators[4]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan4"/>
      <dl_setting VAR="actuators[5]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan5"/>
      <dl_setting VAR="actuators[6]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan6"/>
      <dl_setting VAR="actuators[7]" MIN="900" STEP="1" MAX="2100" module="actuators" shortname="chan7"/>
    </dl_settings>
</settings>

Vehicle-side configuration

On the vehicle side we are using a twog for hardware so we will use the setup_actuators target found in /conf/autopilot/setup.makefile. This makefile is used by the tiny.makefile which is used because we specify we're using the twog in twinjet_overo.xml

  <firmware name="fixedwing">
    <target name="ap" 			board="twog_1">

The setup target is defined as follows in the airframe (twinjet_overo.xml):

  <firmware name="setup">
    <target name="tunnel" 		board="twog_1" />
    <target name="setup_actuators" 	board="twog_1" />
  </firmware>

If we were adding the joystick to the autopilot code we could instead add the following line to the firmware section:

<subsystem name="joystick"/>

but that's another project...

Here's the setup.makefile section that worked for me:

setup_actuators.CFLAGS += -DFBW -DLED -DTIME_LED=1 -DACTUATORS=\"servos_4017_hw.h\" -DSERVOS_4017
setup_actuators.CFLAGS += -DUSE_UART1 -DUART1_BAUD=B57600 -DDOWNLINK_DEVICE=Uart1 -DPPRZ_UART=Uart1 
setup_actuators.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ 
setup_actuators.CFLAGS += -DDOWNLINK_FBW_DEVICE=Uart1 -DDOWNLINK_AP_DEVICE=Uart1
setup_actuators.srcs += sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c pprz_transport.c downlink.c actuators.c setup_actuators.c $(SRC_ARCH)/uart_hw.c $(SRC_ARCH)/servos_4017_hw.c main.c