Skip to content

Commit

Permalink
Some more instructions for Linux build.
Browse files Browse the repository at this point in the history
Sort GCC diagnostic ignore lines.
Update SITL instructions for remote PX4.
  • Loading branch information
clovett committed Feb 21, 2017
1 parent f6269aa commit cfadc8e
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 19 deletions.
9 changes: 5 additions & 4 deletions AirLib/include/common/common_utils/StrictMode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@
#pragma warning(disable:4996)
#endif


// Please keep this list sorted so it is easier to find stuff, also make sure there
// is no whitespace after the traling \, GCC doesn't like that.
#ifdef __GNUC__
#define STRICT_MODE_OFF \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wctor-dtor-privacy\"") \
_Pragma("GCC diagnostic ignored \"-Wdelete-non-virtual-dtor\"") \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
_Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
_Pragma("GCC diagnostic ignored \"-Wold-style-cast\"") \
_Pragma("GCC diagnostic ignored \"-Wredundant-decls\"") \
_Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
_Pragma("GCC diagnostic ignored \"-Wshadow\"") \
_Pragma("GCC diagnostic ignored \"-Wstrict-overflow\"") \
_Pragma("GCC diagnostic ignored \"-Wswitch-default\"") \
_Pragma("GCC diagnostic ignored \"-Wundef\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
_Pragma("GCC diagnostic ignored \"-Wstrict-overflow\"") \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")

/* Addition options that can be enabled
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
Expand Down
9 changes: 5 additions & 4 deletions MavLinkCom/common_utils/StrictMode.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,23 @@
#pragma warning(disable:4996)
#endif


// Please keep this list sorted so it is easier to find stuff, also make sure there
// is no whitespace after the traling \, GCC doesn't like that.
#ifdef __GNUC__
#define STRICT_MODE_OFF \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wctor-dtor-privacy\"") \
_Pragma("GCC diagnostic ignored \"-Wdelete-non-virtual-dtor\"") \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") \
_Pragma("GCC diagnostic ignored \"-Wmissing-field-initializers\"") \
_Pragma("GCC diagnostic ignored \"-Wold-style-cast\"") \
_Pragma("GCC diagnostic ignored \"-Wredundant-decls\"") \
_Pragma("GCC diagnostic ignored \"-Wreturn-type\"") \
_Pragma("GCC diagnostic ignored \"-Wshadow\"") \
_Pragma("GCC diagnostic ignored \"-Wstrict-overflow\"") \
_Pragma("GCC diagnostic ignored \"-Wswitch-default\"") \
_Pragma("GCC diagnostic ignored \"-Wundef\"") \
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"") \
_Pragma("GCC diagnostic ignored \"-Wstrict-overflow\"") \
_Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
_Pragma("GCC diagnostic ignored \"-Wunused-parameter\"")

/* Addition options that can be enabled
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
Expand Down
15 changes: 15 additions & 0 deletions docs/install_eigen.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,18 @@
2. Create a folder with the name `eigen` (e.g. `/lib/eigen`).
3. [Set the environment variable](http://www.computerhope.com/issues/ch000549.htm) `EIGEN_ROOT` to point to that folder location.
4. Unzip Eigen to the folder and then rename the unzipped folder (e.g. `eigen-eigen-da9b4e14c255`) to the name `eigen3`.

## Linux

On Linux if need a command line way to do this try the following:

````
mkdir ~/eigen3
cd ~/eigen3
wget http://bitbucket.org/eigen/eigen/get/3.3.2.zip
unzip 3.3.2.zip
mv eigen-eigen-da9b4e14c255 eigen3
rm 3.3.2.zip
echo export EIGEN_ROOT=~/eigen3 >> ~/.bashrc
source ~/.bashrc
````
29 changes: 26 additions & 3 deletions docs/linux_build.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ sudo add-apt-repository ppa:george-edison55/cmake-3.x -y
sudo apt-get update
````

On Linux you first need a version of GCC that supports `-std=c++14`. Version 6, or newer should work.
Then get the right version of Eigen, see [Install Eigen](install_eigen.md).
You also need the right version of Boost, see [Install Boost](install_boost.md).

Next you need a version of GCC that supports `-std=c++14`. Version 6, or newer should work.
If you don't have version 6 you can get it by running these commands:
````
sudo apt-get update
Expand All @@ -20,16 +23,36 @@ sudo apt-get update
sudo apt-get install gcc-snapshot -y
sudo apt-get update
sudo apt-get install gcc-6 g++-6 -y
````

Now you can either do this, to make gcc 6 your default gcc compiler:
````
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
````
or you can add the following to the cmake command line instead:
````
-D CMAKE_C_COMPILER=gcc-6 -D CMAKE_CXX_COMPILER=g++-6
````

Then run this:
Then run cmake:
````
cmake -D CMAKE_BUILD_TYPE=Debug CMakeLists.txt
````

Now you are ready to build:
````
make
````

Now type `make`.
## Reset cmake

Just a tid bit for those not familiar with cmake, if for any reason you need to re-run cmake to regenerate new make files
(perhaps you want to move boost or eigen) then the following is the equivalent of `clean` for cmake:
````
rm CMakeCache.txt
rm -rf CMakeFiles
````


## Windows cmake
Expand Down
17 changes: 9 additions & 8 deletions docs/sitl.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,20 @@ make posix_sitl_default
```
./build_posix_sitl_default/src/firmware/posix/px4 ./posix-configs/SITL/init/lpe/iris
```
4. Now you can run Unreal environment and connect to SITL via UDP [settings file](settings.md) with UdpIp address 127.0.0.1 and UdpPort 14560,
set UseSerial to false.
5. You should also be able to use QGroundControl just like with actual [flight controller harware](prereq.md).
You should see a message like this you `INFO [simulator] Waiting for initial data on UDP port 14560` which means the SITL PX4 app is
waiting for someone to connect.
4. Now edit [settings file](settings.md) with UdpIp address 127.0.0.1 and UdpPort 14560, set UseSerial to false
5. Run Unreal environment and it should connect to SITL via UDP. You should see a bunch of messages from the SITL PX4 window from
things like local_position_estimator and "commander" and so on.
6. You should also be able to use QGroundControl just like with actual [flight controller harware](prereq.md).
Note that as we don't have physical board, RC cannot be connected directly to it.
So the alternatives are either use XBox 360 Controller or connect your RC using USB port if it has it
(for example, in case of [FrSky Taranis X9D Plus](prereq.md)) or using trainer USB cable to PC.
This makes your RC look like joystick. You will need to do extra set up in QGroundControl to use RC control as below.

If you want to run the above posix_sitl in a VirtualBox Ubuntu machine then it will have a different ip address from localhost.
So in this case you need to do the following:
1. Run the sitl so it is "listening", you should see the message `INFO [simulator] Waiting for initial data on UDP port 14560`
2. Edit the [settings file](settings.md) so that the UseSerial is false, the UdpIp address is the ip address of your virtual machine
and the LocalIpAddress is the address of your host machine running the Unreal engine.
If you want to run the above posix_sitl in a `VirtualBox Ubuntu` machine then it will have a different ip address from localhost.
So in this case you need to set the [settings file](settings.md) with the UdpIp address set to the ip address of your virtual machine
and the LocalIpAddress is the address of your host machine running the Unreal engine.

# Using Joystick/Gamepad (Alternative to RC)
Why do you need RC for simulator? Because usual joysticks are not very accurate and in fact very "noisy" for flying!
Expand Down

0 comments on commit cfadc8e

Please sign in to comment.