Bashrc Variables
The MRS UAV System relies on environment variables defined in ~/.bashrc to configure the UAV's identity, sensor setup, and ROS parameters. These are set interactively via the setup utility's PostInstall > Setup bashrc option, but can also be edited manually.
Variable Reference
| Variable | Default | Description |
|---|---|---|
UAV_NAME | uav1 | ROS namespace for this UAV (e.g., uav1, uav2, uav35). Must match the hostname. |
RUN_TYPE | realworld | realworld for a physical UAV, simulation for simulation. |
UAV_TYPE | x500 | Frame type. Must match a config file in mrs_uav_deployment/config/mrs_uav_system. |
UAV_MASS | 3.0 | Mass of the UAV in kg (with battery and propellers). |
WORLD_NAME | kn_yard | Default world/location name (e.g., kn_yard, cisar). |
INITIAL_DISTURBANCE_X | 0.0 | Initial X disturbance in Newtons. Usually 0.0. |
INITIAL_DISTURBANCE_Y | 0.0 | Initial Y disturbance in Newtons. Usually 0.0. |
PIXGARM | true | Whether Garmin rangefinder data is routed through Pixhawk. |
OLD_PX4_FW | false | Set to true only for old PX4 1.12 firmware (Pixhawk 4 used in MRS). |
ROS_DISTRO | jazzy | ROS2 distribution. |
RMW_IMPLEMENTATION | rmw_zenoh_cpp | ROS2 middleware implementation. |
UAV_TYPE Configuration
The UAV_TYPE variable must match one of the YAML configuration files in:
~/git/mrs_uav_deployment/config/mrs_uav_system/
Files follow the naming pattern: <frame_name>_<motor_model>_<add_info>.yaml
If no motor model is specified in the filename, the UAV uses the original/standard motor model for that frame.
If you are deploying a new drone/frame/motor/propeller configuration that doesn't have an existing config file, you need to create one and measure the thrust constants.
Verifying Variables
After setting the variables, source the bashrc and verify:
source ~/.bashrc
echo $UAV_NAME # Should match hostname
echo $UAV_TYPE # Should match a config file
echo $UAV_MASS # Should be the measured mass
The UAV Check script also validates that UAV_NAME matches the system hostname.