issues compiling master re uavcan

481 views
Skip to first unread message

Randy Mackay

unread,
Mar 8, 2016, 1:41:25 AM3/8/16
to drones-...@googlegroups.com

A recent change in our use of uavcan as a submodule may cause your build of px4-v2 to fail.  It did for me anyway and displayed this error:

fatal: Not a git repository: ../c:/Users/rmackay9/Documents/GitHub/rmackay9-ardupilot/.git/modules/modules/uavcan/modules/dsdl

Unable to find current revision in submodule path 'dsdl'

 

No amount of “git submodule init” or “git submodule update” calls would fix this but Michael De Breuil gave me the fix which is to delete this folder:

/ardupilot/modules/uavcan/modules/dsdl

 

Sadly I immediately faced another compiler failure related to the PX4Firmware submodules’s uavcan submodule (i.e. a nested submodule) which I have not yet overcome but I will post again when I do in case others are suffering from this as well:

c:/Users/rmackay9/Documents/GitHub/rmackay9-ardupilot/modules/PX4Firmware/src/modules/uavcan/uavcan_main.hpp:42:44: fatal error: uavcan/protocol/param/GetSet.hpp: No such file or directory

 

-Randy

 

Holger Steinhaus

unread,
Mar 8, 2016, 2:08:32 AM3/8/16
to drones-discuss
Never seen the issues you are quoting here, but I also never tried to compile on a Windows machine. However, I guess it is relateded to the new submodules of the The UAVCAN submodule itself.

I would suggest a to do  a "git submodule update --recursive --init" first. If that dosn't help, rm -rf the modules/uavcan directory and try the same command again, Finally, try a fresh "git clone --recursive". I'll be around in gitter in about an hour.

Regards,
  Holger

Lucas De Marchi

unread,
Mar 8, 2016, 7:13:09 AM3/8/16
to drones-discuss
And check git submodule update is actually working... If you have
stray files that would be overwritten it will fail.

To stay on the safe side: git clean -ffxd && git submodule foreach
git clean -ffxd

Lucas De Marchi
> --
> 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.



--
Lucas De Marchi

Randy Mackay

unread,
Mar 8, 2016, 7:38:37 AM3/8/16
to drones-...@googlegroups.com
Lucas, Holger,

Thanks for the advice. I’m still completely stuck sadly.

rmackay9@RANDY-XPS /C/Users/rmackay9/Documents/GitHub/rmackay9-ardupilot (master)
$ git submodule update --recursive --init
Submodule 'dsdl' (https://github.com/UAVCAN/dsdl) registered for path 'dsdl'
Cloning into 'dsdl'...
remote: Counting objects: 515, done.
rRemote: Total 515 (delta 0), reueceiving objects: 74sed 0 (delta 0), pack-reus
Receiving objects: 77% (397/515)
Receiving objects: 100% (515/515), 66.27 KiB, done.
Resolving deltas: 100% (283/283), done.
fatal: Not a git repository: ../../../../../../.git/modules/modules/uavcan/modul
es/libuavcan/dsdl_compiler/pyuavcan/modules/dsdl
Failed to recurse into submodule path 'libuavcan/dsdl_compiler/pyuavcan'
Failed to recurse into submodule path 'modules/uavcan'

One weird thing is I have one working directory on my machine called "ardupilot" which is cloned from master and another called "rmackay9-ardupilot" which is cloned from my fork of master. The "ardupilot" directory always works even if I do a "git checkout randy/master". The rmackay9-ardupilot directory never works even if I do a "git checkout trunk/master". So clearly something good has happened to the "ardupilot" directory but the "rmackay9-ardupilot" directory is toast. Zapping rmackay9-ardupilot and recloning it doesn't help.

-Randy

Holger Steinhaus

unread,
Mar 8, 2016, 10:15:14 AM3/8/16
to drones-discuss
Hi Randy, 

I have just set up a Windows dev environment (Windows 7 Pro 64bit) using the instructions on http://dev.ardupilot.com/wiki/building-px4-with-make . After installing toolchain and Github shell, I issued the following commands:

mkdir /c/projects
cd /c/projects
cd ardupilot/Arducopter
make px4-v2

After more than 10 minutes this resulted in a completed build without errors. I have cross-checked the same with a fresh recursive clone form https://github.com/rmackay9/rmackay9-ardupilot .The build succeeds as well. My earlier guesswork regarding the dsdl compiler failing on Windows has definitely proven wrong, the directorymodules\PX4Firmware\Build\px4fmu-v2_APM.build\<your-path>\ardupilot\modules\PX4Firmware\src\modules\uavcan\dsdlc_generated is fully populated after the build (I have pointed you to a wrong location erlier). I still think the dsdlc could somehow be related with your build trouble - may be you have some incompatible Python version or Python modules installed in PATH? Unfortunately this is very hard for me to debug when the build is not failing. The only other possible reason is some kind of dirty build directory. Is there something like ccache on Windows? If so, may be it is fooling you? Maybe a way to break the chain is to have other Python versions in the PATH than the one supplied with the PX4 toolchain?

A few words about UAVCAN DSDL in general and what it does - may be that helps: UAVCAN is using a platform independent description language, that specifies all messages transferred and services called between UAVCAN nodes. It is in this respect very similar to MavLink. This DSDL definitions should be found under modules/uavcan/dsdl/uavcan/ after submodules have been initialized successfully. During build, the DSDL code is translated into C bindings (mostly headers), which should go into dsdlc_generated. This is done by the dsdlc compiler, which is a python script. The compiler relies on pyuavcan (a Python module), which should be found under modules/uavcan/pyuavcan . Both, the dsdl directory and pyuavcan are submodules of libuavcan to make sure that they are in sync with libuavcan (which is called "uavcan" only in ArudPilot for historic reaons). All Python scripts should work fine with both Python 2.7 or Python 3.4. I have never tested other versions, but the PX4 toolchain contains Python 2.7.3, so this requirement should be fulfilled. 

If this all doesn't help - do you have a chance to cross-test on a fresh Windows installation/VM?

Regards,  
  Holger

Tom Pittenger

unread,
Mar 8, 2016, 11:21:49 AM3/8/16
to drones-discuss
This is broken for me too on Win7. I can do a fresh checkout on a new computer but my existing one even after a clean -fxcd foreach still says this on sourcetree:

git -c diff.mnemonicprefix=false -c core.quotepath=false submodule sync
Synchronizing submodule url for 'modules/PX4Firmware'

Synchronizing submodule url for 'modules/PX4NuttX'

Synchronizing submodule url for 'modules/gbenchmark'

Synchronizing submodule url for 'modules/gtest'

Synchronizing submodule url for 'modules/mavlink'

Synchronizing submodule url for 'modules/uavcan'

Synchronizing submodule url for 'modules/waf


git -c diff.mnemonicprefix=false -c core.quotepath=false submodule update --recursive -- modules/uavcan
error: The following untracked working tree files would be overwritten by checkout:
dsdl/uavcan/Timestamp.uavcan
dsdl/uavcan/equipment/actuator/Command.uavcan
dsdl/uavcan/equipment/camera_gimbal/Mode.uavcan

dsdl/uavcan/equipment/indication/RGB565.uavcan
dsdl/uavcan/equipment/indication/SingleLightCommand.uavcan
dsdl/uavcan/protocol/CANIfaceStats.uavcan
dsdl/uavcan/protocol/DataTypeKind.uavcan
dsdl/uavcan/protocol/HardwareVersion.uavcan
dsdl/uavcan/protocol/SoftwareVersion.uavcan
dsdl/uavcan/protocol/debug/LogLevel.uavcan
dsdl/uavcan/protocol/file/EntryType.uavcan
dsdl/uavcan/protocol/file/Error.uavcan
dsdl/uavcan/protocol/file/Path.uavcan
dsdl/uavcan/protocol/param/Value.uavcan
Please move or remove them before you can switch branches.
Aborting


Problem was solved by:
cd arudpilot/modules/uavcan/dsdl
rm uavcan -rf



--

Tom Pittenger

unread,
Mar 8, 2016, 11:45:41 AM3/8/16
to drones-discuss
and Lucas, please warn people when using "git clean -ffxd". For eclipse users it will completely ruin your day

Lucas De Marchi

unread,
Mar 8, 2016, 1:15:11 PM3/8/16
to drones-discuss
On Tue, Mar 8, 2016 at 1:45 PM, Tom Pittenger <t...@airphrame.com> wrote:
> and Lucas, please warn people when using "git clean -ffxd". For eclipse
> users it will completely ruin your day

Hi Tom,

Ideally IDEs should *not* keep project files inside the repository
exactly for this reason. Sorry it caused trouble to you.

Lucas De Marchi

Randy Mackay

unread,
Mar 8, 2016, 9:44:38 PM3/8/16
to drones-...@googlegroups.com

Ok, so the issue was the length of the directory path where the generated files from uavcan (in the PXFirmware sub module) are created. The max length is apparently about 260 characters and I was just going over this.

The path where the files were being generated was something like this (which is 223 characters but perhaps I've got something slightly wrong or missing):
C:\Users\rmackay9\Documents\GitHub\rmackay9-ardupilot\modules\PX4Firmware\Build\px4fmu-v2_APM.build\c\Users\rmackay9\Documents\GitHub\rmackay9-ardupilot\modules\PX4Firmware\src\modules\uavcan\dsdlc_generated\uavcan\protocol

The short-term solution I've taken is just to shorten the directory name from "rmackay9-ardupilot" to "r9-ardupilot" and that gets it just under the limit.

-Randy

-----Original Message-----
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Lucas De Marchi

Randy Mackay

unread,
Mar 8, 2016, 11:05:05 PM3/8/16
to drones-...@googlegroups.com
I've also found that now we need to type this command into a terminal to get things compiling with a new repo:
git submodule update --init --recursive

I've added this to the windows make instructions but maybe this should be done automatically as part of the build?
http://dev.ardupilot.com/wiki/building-px4-with-make/

-Randy

-----Original Message-----
From: Randy Mackay [mailto:rmac...@yahoo.com]
Sent: 9-Mar-16 11:45 AM
To: 'drones-...@googlegroups.com'
Subject: RE: [Bulk] Re: [drones-discuss] Re: issues compiling master re uavcan


Ok, so the issue was the length of the directory path where the generated files from uavcan (in the PXFirmware sub module) are created. The max length is apparently about 260 characters and I was just going over this.

The path where the files were being generated was something like this (which is 223 characters but perhaps I've got something slightly wrong or missing):
C:\Users\rmackay9\Documents\GitHub\rmackay9-ardupilot\modules\PX4Firmware\Build\px4fmu-v2_APM.build\c\Users\rmackay9\Documents\GitHub\rmackay9-ardupilot\modules\PX4Firmware\src\modules\uavcan\dsdlc_generated\uavcan\protocol

The short-term solution I've taken is just to shorten the directory name from "rmackay9-ardupilot" to "r9-ardupilot" and that gets it just under the limit.

-Randy

-----Original Message-----
From: drones-...@googlegroups.com [mailto:drones-...@googlegroups.com] On Behalf Of Lucas De Marchi
Sent: 9-Mar-16 3:15 AM
To: drones-discuss
Reply all
Reply to author
Forward
0 new messages