Skip to main content

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

VariableDefaultDescription
UAV_NAMEuav1ROS namespace for this UAV (e.g., uav1, uav2, uav35). Must match the hostname.
RUN_TYPErealworldrealworld for a physical UAV, simulation for simulation.
UAV_TYPEx500Frame type. Must match a config file in mrs_uav_deployment/config/mrs_uav_system.
UAV_MASS3.0Mass of the UAV in kg (with battery and propellers).
WORLD_NAMEkn_yardDefault world/location name (e.g., kn_yard, cisar).
INITIAL_DISTURBANCE_X0.0Initial X disturbance in Newtons. Usually 0.0.
INITIAL_DISTURBANCE_Y0.0Initial Y disturbance in Newtons. Usually 0.0.
PIXGARMtrueWhether Garmin rangefinder data is routed through Pixhawk.
OLD_PX4_FWfalseSet to true only for old PX4 1.12 firmware (Pixhawk 4 used in MRS).
ROS_DISTROjazzyROS2 distribution.
RMW_IMPLEMENTATIONrmw_zenoh_cppROS2 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.

warning

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.