ROS package for AEAC simulation and testing
In the aeac_ws directory run the following:
catkin clean # type "y" then enter (probably not necessary to clean, but if you are having problems try this)
catkin build
If on Linux run xhost +local: in your terminal to allow X11 forwarding from your local machine, if on Wayland you will need xwayland (installed by default on most environments).
If on Windows you will need an X Server and to export the DISPLAY environment variable in your container. There are multiple ways to achieve this but one option is:
Install VcXsrv Windows X Server
IMPORTANT: Our version of Gazebo (the simulation software) does not work on Mac with no known workaround, see wiki for creating a VM. You are welcome to try nonetheless.
If on Mac you will also need an X Server:
In a terminal run the following commands:
roslaunch simulation_testing simulation_UTIAS.launch
# new terminal
rosrun flight_stack ex_hover.py
# or
rosrun flight_stack ex_square.py
# etc.To run the landing pad simulation close the first simulation with ctrl+c and run the following commmands:
roslaunch simulation_testing simulation_UTIAS_landing.launch
# new terminal
rosrun simulation_testing test_landing_pad.pyIn either case after running roslaunch you should see that a port has been automatically forwarded, going to that link should load the web viewer into your browser. If you do not see it go to the ports tab and check what port 5000 was forwarded to on your local machine (most likely localhost:5000), click on the link to open it in your browser. Webviewer only tested in Firefox, but other browsers should be fine.
The simulation is finicky, sometimes the drone will takeoff even though it is armed and in OFFBAORD. Try killing the flight stack (the program run with rosrun) and run it again, if that does not work check for the following flight warnings in the px4 shell.
Input these param commands in the px4 shell (the terminal where you ran roslaunch).
If you get this warning WARN [commander] Failsafe enabled: No manual control stick input and the drone refuses to takeoff, this is because the drone by default needs a ground station controller to fly, we don't need this in sim so disable it with: (error may still appear but drone will fly)
param set COM_RCL_EXCEPT 4
param set NAV_DLL_ACT 0
param set NAV_RCL_ACT 0
Or run rosrun simulation_testing disable_stick.py in your container shell (a different VScode terminal).
If you get this warning WARN [PreFlightCheck] Preflight Fail: Airspeed Selector module down. and the drone refuses to takeoff disable it with:
(I don't know why this happens, probably don't need it in sim)
param set CBRK_AIRSPD_CHK 162128
If you get WARN [PreFlightCheck] Mode not suitable for takeoff after changing the params in the px4 shell run:
commander mode auto:loiter
If this does not work or you get any other error try restarting the sim first for the changes to take effect.
Parameters should be saved between launches, but not from container rebuilds.
- Create a new file in
scripts chmod +x- Open the file and insert the boiler plate with
!fs<enter>
This repository should hold completed Flight Stacks for testing competition tasks in sim, and eventually on the drone. Repository should also contain any simulation files required for aforemetioned testing.
Test cases should also go here for regression testing.
Tasks may require custom functionality to be added to module classes. Implement them in the Flight Stack script, but changes should not live permanently here, if a change is required open a pull request. Otherwise reconsider why you need to edit the module class.
Test new State classes here, if they would be useful to other Flight Stacks open a pull request to basic_states.
roslaunch simulation_testing real.launch will start core scripts and set params. Run other ROS nodes as needed (or add to launch file).
roslaunch simulation_testing gcs.launch will launch the gstreamer ROS bridge and start the webviewer locally.
You need to source set_env_real.sh in scripts before running if you are in the container (or have not set the proper env vars locally).
TODO: make this more automatic (real.launch needs adjustment and stuff, maybe like cli interface or tui prompt)
- make package.xml actually legit (applies to all repos)
- new drone model
- accurate shredder/cyclone model
- new world models
- comp environments
- automated testing
- currently you have to manually watch the sim to see if the basic flight stacks work
- implement a headless gazebo sim that runs the basic flight stacks and check for completeness
- Improve sim debugging
- movable markers
- visualize position tracking etc.
- remotely move drone/objects
- add comp objects (hanging bucket, ir thingies)
- movable markers