-
Notifications
You must be signed in to change notification settings - Fork 84
CrazyS on Arch Linux with ROS Melodic and Gazebo 10
To use the code developed and stored in this repository some preliminary actions are needed. They are listed below.
Before starting, since a lot of packages will be installed, it is recommended to use an AUR helper like yay or pikaur. A larger more verbose list of AUR helpers can be found within the ArchLinux wiki page for AUR helpers. This tutorial will assume the use of yay as the AUR helper.
It is also recommended to use the arch4edu repository. They are hosting many packages related to education and research, including robotics. Adding a repository allows installing binaries of packages, instead of compiling them from source. This will greatly speed up your installation time. Visit here to add and use arch4edu. Another option is the oscloud repository.
- Install and initialize ROS Melodic desktop full, additional ROS packages,
catkin-tools
, andwstool
:
$ yay -S ros-melodic-desktop-full
$ sudo rosdep init
$ rosdep update
$ echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
$ yay -S ros-melodic-desktop-full ros-melodic-joy ros-melodic-octomap-ros ros-melodic-mavlink
$ yay -S python-wstool python-catkin-tools protobuf-compiler libgoogle-glog-dev ros-melodic-control-toolbox
$ yay -S python-rosinstall python-rosinstall-generator build-essential
- If you don't have ROS workspace yet you can do so by
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ catkin_init_workspace # initialize your catkin workspace
$ cd ~/catkin_ws/
$ catkin init
$ cd ~/catkin_ws/src
$ git clone -b dev/ros-melodic https://github.com/gsilano/CrazyS.git
$ git clone -b med18_gazebo9 https://github.com/gsilano/mav_comm.git
$ cd ~/catkin_ws
- Build your workspace with
python_catkin_tools
(therefore you needpython_catkin_tools
)
$ rosdep install --from-paths src -i
$ yay -S ros-melodic-rqt-rotors ros-melodic-rotors-comm ros-melodic-mav-msgs ros-melodic-rotors-control
$ yay -S ros-melodic-rotors-gazebo ros-melodic-rotors-evaluation ros-melodic-rotors-joy-interface
$ yay -S ros-melodic-rotors-gazebo-plugins ros-melodic-mav-planning-msgs ros-melodic-rotors-description ros-melodic-rotors-hil-interface
$ rosdep update
$ catkin build
- Add sourcing to your
.bashrc
file
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
- Run the hovering example
$ roslaunch rotors_gazebo crazyflie2_hovering_example.launch
In the event that the simulation does not start, the problem may be related to Gazebo and missing packages. It is recommended to set options debug
and verbose
to true
in crazyflie2_hovering_example.launch
to further inspect the issue, in the command-line output of the simulation.
If the problem does not fall in one of the following categories you might need to investigate on your own. Inspect the outputs and open an issue. Some details are reported in #25 and in #40.
As a result of using catkin build
(instead of catkin_make
), it is possible that the dependency for libmav_msgs
is not satisfied. If libmav_msgs.so
is not present in devel/lib/
you need to copy it there or link to it from build/rotors_gazebo_plugins/libmav_msgs.so
. Use the following commands to create a soft link to the shared object.
cd ~/catkin_wc
ln -s build/rotors_gazebo_plugins/libmav_msgs.so devel/lib/libmav_msgs.so
As pointed out by @dbenders1, a more elegant solution to solve the problem is described at this link. Therefore, it would be sufficient to simply reorder the contents of the CMakeList.txt
file.
Arch Linux is a rolling release. If any other shared libraries cannot be located it is quite possible that they have been updated while some other dependency still depends on the previous version. In such cases, it is common to create a soft link in place of the previous version. Below an example of the process for libopencv_imgproc.so
. The system has version 4.3 while the binary is looking for 4.2.
# Example
ln -s /usr/lib/libopencv_imgproc.so.4.3 /usr/lib/libopencv_imgproc.so.4.2
As a last resort, a blanket installation of all the ros-melodic-*
packages can be done as follows:
$ yay -Ssq ros-melodic- # First, inspect the packages
$ yay -S $(yay -Ssq ros-melodic-) # Then, install
How to add
How to create
- Creating ROS Plugins for Gazebo
- Gazebo and Gazebo ROS Installation
- Gazebo Topic Naming Conventions
- ROS Interface Plugin
- Setup virtual keyboard joystick
How to install
How to generate
How to set
- Setting up CrazyS as Fixed Wing HiL Simulation (Pixhawk, Mavros, Mavlink, QGC)
- Setting up the CrazyS Simulator
How to develop
- Include ordering in cpp and header files
- Interfacing CrazyS through MATLAB
- Interfacing CrazyS with TravisCI
- Interfacing CrazyS with GitHub Action
- Package Versioning
- Software Specifications
- Specifying constants and default values
- Working With Meshes in Gazebo
More information