Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mavros build issue #34

Closed
vmayoral opened this issue Jun 18, 2014 · 12 comments
Closed

mavros build issue #34

vmayoral opened this issue Jun 18, 2014 · 12 comments

Comments

@vmayoral
Copy link

The steps followed in a BeagleBone-based board are described here.

Basically:

....
Found 123 MAVLink message types in 2 XML files
Generating C implementation in directory /root/catkin_ws/devel/include/mavlink/v1.0/pixhawk
Generating C implementation in directory /root/catkin_ws/devel/include/mavlink/v1.0/common
Copying fixed headers
Traceback (most recent call last):
  File "/root/catkin_ws/src/mavros/mavlink/pymavlink/generator/mavgen.py", line 166, in <module>
    mavgen(opts, args)
  File "/root/catkin_ws/src/mavros/mavlink/pymavlink/generator/mavgen.py", line 93, in mavgen
    mavgen_c.generate(opts.output, xml)
  File "/usr/local/lib/python2.7/dist-packages/pymavlink/generator/mavgen_c.py", line 650, in generate
    copy_fixed_headers(basename, xml_list[0])
  File "/usr/local/lib/python2.7/dist-packages/pymavlink/generator/mavgen_c.py", line 493, in copy_fixed_headers
    shutil.copy(src, dest)
  File "/usr/lib/python2.7/shutil.py", line 117, in copy
    copyfile(src, dst)
  File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/usr/local/lib/python2.7/dist-packages/pymavlink/generator/C/include_v1.0/pixhawk/pixhawk.pb.h'
make[2]: *** [mavros/pixhawk.xml-v1.0-stamp] Error 1
make[1]: *** [mavros/CMakeFiles/pixhawk.xml-v1.0.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

It seems to me like i'm missing some dependencies. btw, package looking really good.

@vooon
Copy link
Member

vooon commented Jun 18, 2014

I have not tried to build groovy (started from hydro).
But logs shows mavgen related problems. As a workaround you can pip install pymavlink.

In the next release I will change this phase with dependence to ros-*-mavlink (see #35).

@vooon
Copy link
Member

vooon commented Jun 18, 2014

I found, that pymavlink/setup.py creates buggy generator package (some files not included in resulting package).
So pip install pymavlink does nothing (same broken generator).

I just released 0.5.0, it wants ros-hydro-mavlink package (or indigo). Debs for indigo are built, but not yet pushed to public repository.
Additionaly that package provides pymavlink (almost same as pip).

@vmayoral
Copy link
Author

@vooon thanks for the follow up. I'm using groovy on my tests but no problem updating to hydro if necessary. Any update on whether it's going to be possible to run mavros in groovy?

@vooon
Copy link
Member

vooon commented Jun 19, 2014

I've never tried to build on groovie, and now indigo on all machines.
I recommend to upgrade to hydro, but you can try to build release for hydro.

For source install wstool merge or create new ws with rosinstall.yaml:

- git:
    local-name: mavros
    uri: https://github.com/vooon/mavros-release.git
    version: release/hydro/mavros/0.5.0-0
- git:
    local-name: mavlink
    uri: https://github.com/vooon/mavlink-gbp-release.git
    version: release/hydro/mavlink/1.0.9-4

Then build with catkin_make_isolated (build isolation required for mavlink).

@vmayoral
Copy link
Author

@vooon thanks. Will follow your recommendation and update to hydro.

@vooon
Copy link
Member

vooon commented Jun 26, 2014

Any update?

@vmayoral
Copy link
Author

I dedicated a couple more hours installing 'hydro' and compiling mavlink by hand using catkin_make_isolated. The package seems to compile fine and is deployed in my workspace under build_isolated and devel_isolated.

I manually copied the content of the build to the usual build and devel directories and executed catkin_make on the workspace. I'm expecting mavros to compile but it still doesn't find the mavlink dependency:

root@erlerobot:~/catkin_ws_hydro# catkin_make
Base path: /root/catkin_ws_hydro
Source space: /root/catkin_ws_hydro/src
Build space: /root/catkin_ws_hydro/build
Devel space: /root/catkin_ws_hydro/devel
Install space: /root/catkin_ws_hydro/install
####
#### Running command: "make cmake_check_build_system" in "/root/catkin_ws_hydro/build"
####
-- Using CATKIN_DEVEL_PREFIX: /root/catkin_ws_hydro/devel
-- Using CMAKE_PREFIX_PATH: /root/catkin_ws_hydro/devel;/opt/ros/hydro
-- This workspace overlays: /root/catkin_ws_hydro/devel;/opt/ros/hydro
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /root/catkin_ws_hydro/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.81
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - mavros
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'mavros'
-- ==> add_subdirectory(mavros)
CMake Error at mavros/CMakeLists.txt:22 (find_package):
  Could not find module Findmavlink.cmake or a configuration file for package
  mavlink.

  Adjust CMAKE_MODULE_PATH to find Findmavlink.cmake or set mavlink_DIR to
  the directory containing a CMake configuration file for mavlink.  The file
  will have one of the following names:

    mavlinkConfig.cmake
    mavlink-config.cmake



-- mavros: 7 messages, 15 services
CMake Error at /opt/ros/hydro/share/catkin/cmake/catkin_package.cmake:156 (message):
  catkin_package() DEPENDS on 'mavlink' which must be find_package()-ed
  before.  If it is a catkin package it can be declared as CATKIN_DEPENDS
  instead without find_package()-ing it.
Call Stack (most recent call first):
  /opt/ros/hydro/share/catkin/cmake/catkin_package.cmake:98 (_catkin_package)
  mavros/CMakeLists.txt:128 (catkin_package)


-- Configuring incomplete, errors occurred!
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

Any idea of what i'm doing wrong?

@vmayoral
Copy link
Author

They are where i assume they should be:

root@erlerobot:~/catkin_ws_hydro# ls build
catkin            CATKIN_IGNORE      CMakeCache.txt  cmake_install.cmake  gtest     mavlink      mavros
catkin_generated  catkin_make.cache  CMakeFiles      CTestTestfile.cmake  Makefile  mavlink_ros  test_results
root@erlerobot:~/catkin_ws_hydro# ls devel
env.sh  etc  include  lib  mavlink  setup.bash  setup.sh  _setup_util.py  setup.zsh  share

And the previous catkin_make_isolated seems to have run properly

@vooon
Copy link
Member

vooon commented Jun 26, 2014

What a way to install hydro?
For wandboard i build it from source, here is my helper script.

I do not know exactly, but I think that you need to copy to devel. And try use from install directory (catkin_make_isolated --install).
Or better install it to ROS distro (usually /opt/ros/hydro), set --install-space and --install (see script).

Debs for x86 available at packages.ros.org shadow repo ros-hydro-mavlink and ros-hydro-mavros

@vmayoral
Copy link
Author

@vooon thanks for following up. That did it.

For now i can just launch ardupilot using TCP ports so i guess that i'll need to way until the new boards arrive and i can connect it to a serial port (UDP has not been implemented on BeaglePilot yet).

Will keep you posted.

@vooon
Copy link
Member

vooon commented Jun 26, 2014

Now mavros support only serial device on autopilot side. But you can use socat for creating PTY device and use it as ~serial_port.

@vmayoral
Copy link
Author

That's a great idea :)! Will give it a try tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants