file locations for ardupilot on Linux

470 views
Skip to first unread message

Randy Mackay

unread,
Dec 28, 2015, 9:29:49 PM12/28/15
to drones-...@googlegroups.com, Andrew Tridgell, lucas.d...@gmail.com

We discussed where things should be put on linux boards and this is what I captured from that discussion.

 

Parameters: /etc/ardupilot/ardupilot.conf

                         /etc/ardupilot/copter/defaults.parm OR /etc/ardupilot/defaults/copter/

Binaries: /usr/bin/arducopter

Local builds: /usr/local/bin/arducopter

Dataflash logs: /var/ardupilot/logs/1.BIN

Pictures: /var/ardupilot/images

Loadable Modules:/etc/ardupilot/modules.d/*.so

 

Note: our virtual eeprom stores data in “/var/APM/ArduCopter.stg” and we should consider moving this to “/var/ardupilot/ArduCopter.stg” or “/var/ardupilot/arducopter.stg”

 

-Randy

Víctor MV

unread,
Dec 29, 2015, 10:07:07 AM12/29/15
to drones-discuss, tri...@tridgell.net, lucas.d...@gmail.com
+1 for this. Thanks Randy for bringing it up.

Ramon Roche

unread,
Dec 29, 2015, 11:21:32 AM12/29/15
to drones-...@googlegroups.com, tri...@tridgell.net, lucas.d...@gmail.com
+1

Should we move the Pictures path to a more standardized location on user space? /home/user/(media|pictures|photos|images)/ardupilot, or make this path configurable through ardupilot.conf

And while on topic, should we also take the time to standardize on a file naming convention using lowercase?, or at least not mixing CamelCase with lowercase or any other formatting


On Tue, Dec 29, 2015 at 7:07 AM, Víctor MV <v.may...@gmail.com> wrote:
+1 for this. Thanks Randy for bringing it up.

--
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.



--
"People and Attitudes Cause Accidents, not Technology and Equipment" Thom Yorke

Ramón Roche

Lucas De Marchi

unread,
Dec 29, 2015, 12:13:34 PM12/29/15
to Ramon Roche, drones-discuss, tri...@tridgell.net
Hi Ramon,

On Tue, Dec 29, 2015 at 2:21 PM, Ramon Roche <mrp...@gmail.com> wrote:
> +1
>
> Should we move the Pictures path to a more standardized location on user
> space? /home/user/(media|pictures|photos|images)/ardupilot, or make this
> path configurable through ardupilot.conf

The idea of this standardization we are talking about is to be more
similar to "normal" programs running on Linux. In this sense ardupilot
is a daemon started during boot. These usually don't save data on the
user directory, but rather use /var (think for example the apache web
server, sshd, bluetoothd, etc.

So, if the images/video are being generated by ardupilot (right now
they aren't), then we would save them on /var/ardupilot/images,
/var/ardupilot/video, etc.
If it's another program saving the images, video, then they can save
wherever they want.

One thing we could do to allow ardupilot to save to a certain user
directory rather than system directory is to have an entry in the
configuration file allowing to set the base data directory as you
suggest.

> And while on topic, should we also take the time to standardize on a file
> naming convention using lowercase?, or at least not mixing CamelCase with
> lowercase or any other formatting

We are preferring to use lowercase. This includes the binary name:
arducopter, arduplane, etc and installed on /usr/bin

Lucas De Marchi

Al B

unread,
Dec 29, 2015, 12:29:30 PM12/29/15
to drones-discuss, tri...@tridgell.net, lucas.d...@gmail.com
Wiki pages will have to be updated then.  e.g. Building-for-navio-on-rpi2 suggests to copy the .elf file under /opt/apm/bin/ and the logs are currently generated under /var/APM/logs 

Lucas De Marchi

unread,
Dec 29, 2015, 12:43:37 PM12/29/15
to Al B, drones-discuss, tri...@tridgell.net
On Tue, Dec 29, 2015 at 3:29 PM, Al B <cagi...@gmail.com> wrote:
> Wiki pages will have to be updated then. e.g. Building-for-navio-on-rpi2
> suggests to copy the .elf file under /opt/apm/bin/ and the logs are
> currently generated under /var/APM/logs

Yep, they will be changed when we implement these things, which
includes parts on build system, configuration parsing, etc.


Lucas De Marchi

Chuk Rhodes

unread,
Dec 29, 2015, 12:45:05 PM12/29/15
to drones-discuss, mrp...@gmail.com, tri...@tridgell.net
That all sounds good, but why not keep going... more like existing daemons, from Apache, and some others, at least :

-f config
Uses the directives in the file config on startup

And maybe:


-C directive
Process the configuration directive before reading config files.

-c directive
Process the configuration directive after reading config files.

And the config file should probably specify directories, with the above as default. One could edit /etc/ardupilot/ardupilot.conf to change one dir, or specify a config file with all customizations.

James Harrison

unread,
Dec 30, 2015, 7:31:02 PM12/30/15
to drones-...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 29/12/2015 02:29, 'Randy Mackay' via drones-discuss wrote:
> Parameters: /etc/ardupilot/ardupilot.conf
>
> /etc/ardupilot/copter/defaults.parm OR
> /etc/ardupilot/defaults/copter/
>

The "Linux way" would typically be that /etc/ardupilot/ardupilot.conf
_is_ configured with the defaults, and that you'd edit it directly -
an alternative might be to package both ardupilot.conf and
ardupilot.conf.default, which would keep the defaults around without
users having to manually copy the file as a backup.

> Dataflash logs: /var/ardupilot/logs/1.BIN
>

Why not /var/log/ardupilot/n.bin? Again, packaging consistency on
Debian/Redhat based OSes.

> Pictures: /var/ardupilot/images

This makes total sense to me, though perhaps
/var/lib/ardupilot/images? This would make more sense/align with other
packages in Debian etc.

> Loadable Modules:/etc/ardupilot/modules.d/*.so
>

This kind of jars, in my opinion. These things should be in
/usr/lib/ardupilot - if which modules should be loaded is
configurable, throw that in /etc, but otherwise libs should be in,
well, lib. Even if it were just symlinking in
/etc/ardupilot/modules.d, but a /etc/ardupilot/modules.load file which
just listed which modules to load by path would be preferable imho.

>
>
> Note: our virtual eeprom stores data in “/var/APM/ArduCopter.stg”
> and we should consider moving this to
> “/var/ardupilot/ArduCopter.stg” or “/var/ardupilot/arducopter.stg”
>

Again, would suggest /var/lib/ardupilot instead for consistency with
other packages.

- --
Cheers,
James Harrison
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)

iQIcBAEBAgAGBQJWhHc8AAoJENTyYHL8dmp9rioP/2Sdwmw01HDxM2hu6EbbpE3d
EVT45xnN6Rb+eKLjWOQjRhkScXDZkrHZL4XJJtjm/w++Gvpi187jfEdUjYa0u6DI
aj/iQfn8Sb20Lqe/chmN+9f3g2R6ujjvspRnEmqRvMstzBcyAZ+skJPHIAAXWGIH
5zI+pDtodVUWcfmTDup7HF48b0bwb8UGzHYnK94xzazYUFAzUfBnIcOiT/PsBVk9
SpspazyBNaVp5kFpbrFJ5ybx9CdGMyMU783lUlnj2EdVwqC9gdz/14c1umRKTvgy
PhPhj+agVD5dBq9G1G+drlezmBRYzuzkxXKKXr4mTFdNRWQZkh5xAv3jDjclOPPo
Tr0KB52K50JTw4VUg/9RS7qHa7C4Q40pUG5MmF2ac/VzzldVT02jZhkremAUrwtj
suMYRerZyZH/+lZxa9DTiMlZesd5aA1MLKHHO+GX9xrHo3nNxgdtkK+sIWqibNJW
I/qOIm3nn36xZJY6GP703qt7OOB82BJ1TJvnWmc48DskKTTRNibRCmnSbwQpglhe
8rgMlVMcJoCmcA0THdSe+35Q/zOZ5qxA8+eHHyfyBtcFqCh94C2CiJHWnpqlRQ6a
K5xoPR/aoS5dvJsn9wkYzg6FQ6VZ4+z/KXfDg+R38mb0ZbJwb+lDpcEy0HJ3si0x
vwWFmRumkX6/P3lQw4JU
=wslF
-----END PGP SIGNATURE-----

Lucas De Marchi

unread,
Dec 30, 2015, 9:23:35 PM12/30/15
to drones-discuss
Hi James,

On Wed, Dec 30, 2015 at 10:30 PM, James Harrison
<ja...@talkunafraid.co.uk> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 29/12/2015 02:29, 'Randy Mackay' via drones-discuss wrote:
>> Parameters: /etc/ardupilot/ardupilot.conf
>>
>> /etc/ardupilot/copter/defaults.parm OR
>> /etc/ardupilot/defaults/copter/
>>
>
> The "Linux way" would typically be that /etc/ardupilot/ardupilot.conf
> _is_ configured with the defaults, and that you'd edit it directly -
> an alternative might be to package both ardupilot.conf and
> ardupilot.conf.default, which would keep the defaults around without
> users having to manually copy the file as a backup.

/etc belongs to the user/administrator. If we want to also allow a
"from package configuration", then this should be in /usr. If it's a
"backup" then it's /usr/share, if it's configuration that gets
applied, then it is /usr/lib


>> Dataflash logs: /var/ardupilot/logs/1.BIN
>>
>
> Why not /var/log/ardupilot/n.bin? Again, packaging consistency on
> Debian/Redhat based OSes.

Because this is not the same kind of logs. The logs from the daemon
operation are currently on stdout and could be redirect elsewhere by
the init system of choice. I personally send them to journal since
it's much better maintained there.

The logs we are talking here belong more to the application. They are
the data generated by ardupilot during flight.


>> Pictures: /var/ardupilot/images
>
> This makes total sense to me, though perhaps
> /var/lib/ardupilot/images? This would make more sense/align with other
> packages in Debian etc.

Yeah, may make sense.

>> Loadable Modules:/etc/ardupilot/modules.d/*.so
>>
>
> This kind of jars, in my opinion. These things should be in
> /usr/lib/ardupilot - if which modules should be loaded is
> configurable, throw that in /etc, but otherwise libs should be in,
> well, lib. Even if it were just symlinking in
> /etc/ardupilot/modules.d, but a /etc/ardupilot/modules.load file which
> just listed which modules to load by path would be preferable imho.

This just ended up wrong in the email. In the call we mentioned
leaving them in /usr/lib/ardupilot indeed

>>
>> Note: our virtual eeprom stores data in “/var/APM/ArduCopter.stg”
>> and we should consider moving this to
>> “/var/ardupilot/ArduCopter.stg” or “/var/ardupilot/arducopter.stg”
>>
>
> Again, would suggest /var/lib/ardupilot instead for consistency with
> other packages.

Yep.

We want to make sure to follow a "normal linux package" approach.
There are some variations among distros that could be dealt with with
options to the build system. Like other packages do. But nowadays most
of the places are similar indeed.


thanks

Lucas De Marchi

Daniel Frenzel

unread,
Dec 31, 2015, 4:44:29 AM12/31/15
to drones-discuss
Hi there,
1) I would like to suggest that the linux binaries which can be downloaded are stopped.
The only acceptable way is to write a build file for *.rpm or *.deb and use a build service.

2) The standard output, not the EEPROM stuff, belongs to /var/log

3) There is still a startup service file required

4) The should be also a PID file generated when starting the service

5) It would be nice to create a group so that AP can be started by the user

6) Startup scripts still required. Most users are totally unable to write their own :( 

Fredrik Hedberg

unread,
Jan 4, 2016, 4:54:14 PM1/4/16
to drones-discuss, tri...@tridgell.net, lucas.d...@gmail.com
I know a power manager that's about to get grumpy, but what happened to the APM name? ;)

Randy Mackay

unread,
Jan 5, 2016, 10:41:34 PM1/5/16
to drones-...@googlegroups.com

 

     I’d like to consolidate the outcome of the file location discussion.  I’m not an expert in this area so if there are corrections, can the replies include the entire list with the correction?  Let’s leave no room for doubt or interpretation on the locations.  So for example in the “Loadable Modules” section, I was unsure if the .so files would go into the directory listed below or if there would be an additional directory below this.

 

Parameters: /etc/ardupilot/ardupilot.conf

                         /etc/ardupilot/copter/defaults.parm OR /etc/ardupilot/defaults/copter/

 

Binaries: /usr/bin/arducopter

 

Local builds: /usr/local/bin/arducopter

 

Dataflash logs: /var/ardupilot/logs/1.BIN

Standard output from application: /var/log/ardupilot.log

 

Pictures: /var/lib/ardupilot/images

 

Loadable Modules:/usr/lib/ardupilot/*.so

 

-Randy

--

Lucas De Marchi

unread,
Jan 6, 2016, 12:56:57 AM1/6/16
to drones-discuss

This is the document I shared in our last dev call:

https://docs.google.com/document/d/1Bqf1CcJkgWZBokmNKRm2sqZukezHVZRnGWdiV1sYfN4/edit?usp=docslist_api

Lucas De Marchi

Randy Mackay

unread,
Jan 6, 2016, 1:31:28 AM1/6/16
to drones-...@googlegroups.com

 

     Ah, perfect, thanks!  I had missed that part of the discussion I think.

 

-Randy

Reply all
Reply to author
Forward
0 new messages