SwapUNaph / VTOL_Y4_Firmware

Added model of a tiltrotor Y4 UAV in sitl_gazebo to the original PX4/Firmware repository
Other
16 stars 4 forks source link

Issue Running the code #1

Closed brunoar closed 4 years ago

brunoar commented 4 years ago

Hi Swapneel, Congrats for the awesome work! I've tried to run your model but I'm getting this error:

-- Generating done -- Build files have been written to: /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo [4/7] Performing build step for 'sitl_gazebo' ninja: no work to do. [7/7] cd /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sit.../home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default /bin/sh: 1: /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/Tools/sitl_run.sh: Permission denied FAILED: cd /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/tmp && /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/Tools/sitl_run.sh /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/src/firmware/posix/px4 posix-configs/SITL/init/ekf2 none gazebo vtol_y4 /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default ninja: build stopped: subcommand failed. Makefile:155: recipe for target 'posix_sitl_default' failed make: *** [posix_sitl_default] Error 1

I've had other errors which I've solved downgrading to gazebo 7. Any clue on what's causing this error?

SwapUNaph commented 4 years ago

@brunoar , this error is because you do not have permission to run the script. You would have to use sudo: sudo make posix_sitl_default gazebo_vtol_y4 Or if you wish to not use sudo, you can grant permission for the firmware folder by doing: sudo chown $USER:$USER /path/to/firmware/folder -R

Regards.

brunoar commented 4 years ago

@SwapUNaph , that was also my first guess, weirdly enough I get the exact same error running with sudo or granting permission for the firmware folder

SwapUNaph commented 4 years ago

@brunoar , try this: chmod +x /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/Tools/*.sh

brunoar commented 4 years ago

@SwapUNaph, thank you so much! That did help, gazebo finally started. I'm getting some errors and warnings though, do you have any idea what may be the cause?

[Msg] Waiting for master. Gazebo multi-robot simulator, version 7.16.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org

[Msg] Waiting for master. [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 10.112.98.59 INFO [dataman] Unkown restart, data manager file 'rootfs/fs/microsd/dataman' size is 11797680 bytes INFO [platformsposixdriversledsim] LED::init INFO [platformsposixdriversledsim] LED::init INFO [simulator] Waiting for initial data on UDP port 14560. Please start the flight simulator to proceed.. Warning [parser.cc:835] XML Element[gravity], child of element[model] not defined in SDF. Ignoring[gravity]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element. Warning [parser.cc:835] XML Element[velocity_decay], child of element[model] not defined in SDF. Ignoring[velocity_decay]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element. [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/libLiftDragPlugin.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/libLiftDragPlugin.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/libLiftDragPlugin.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/libLiftDragPlugin.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/librotors_gazebo_motor_model.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/librotors_gazebo_motor_model.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/librotors_gazebo_motor_model.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/librotors_gazebo_motor_model.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/librotors_gazebo_motor_model.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/librotors_gazebo_imu_plugin.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Err] [Plugin.hh:165] Failed to load plugin /home/bruno/Desktop/PAer/src/VTOL_Y4_Firmware/build_posix_sitl_default/build_gazebo/librotors_gazebo_mavlink_interface.so: libboost_thread.so.1.71.0: cannot open shared object file: No such file or directory [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 10.112.98.59

SwapUNaph commented 4 years ago

@brunoar , looks like the compiler is not able find the libboost_thread.so library. You may need to install boost 1.17.0 version. But before that try running other standard gazebo sims given on the page: https://dev.px4.io/master/en/simulation/gazebo.html To test if the problem is with the boost library installation or with the specific version of the firmware. Also as mentioned earlier, this repository is an older version of px4 so you might have to downgrade the dependencies to make it work.

brunoar commented 4 years ago

@SwapUNaph, after installing and uninstalling gazebo again, I managed to run your model. It looks very good! Now, when I try to deploy a mission with QGroundControl, the plane does not follow the mission. I'm trying to vertically take-off and transition, cruise for a while, transition and vertically land. Is there something I'm missing?

SwapUNaph commented 4 years ago

@brunoar, awesome! Now try to follow the official website for running px4 gazebo sim: https://dev.px4.io/master/en/simulation/gazebo.html#taking-it-to-the-sky

I believe QGroundControl doesn't work with Gazebo Sim models. For that you will have to use px4 terminal as mentioned in the above link.

Regards.

brunoar commented 4 years ago

@SwapUNaph Thank you! It is working. Do you know where I can find a list of suitable commands? Up to now I was able to use "commander takeoff" and "commander transition".

SwapUNaph commented 4 years ago

https://dev.px4.io/v1.9.0/en/middleware/modules_main.html

This is the complete command reference for px4. I hope it helps.