Configuration file (PX4)

From UgCS
Jump to: navigation, search

Main Page UgCS Connecting UgCS and PX4

Download this subcategory as PDF file

Default configuration file of the PX4 VSM suits most needs and it is generally not necessary to modify it.

Configuration file location:

Microsoft Windows:
C:\Program Files (x86)\UgCS\bin\vsm-px4.conf


Apple OS X:
/Users/[user name]/Library/Application Support/UGCS/configuration/vsm-px4.conf

Common parameters

All VSMs share a common set of configuration file parameters described in Common configuration file parameters. PX4 VSM configuration file prefix is:


Communication channel configuration

There must be at least one communication channel defined, otherwise VSM will not try to connect to the vehicle. See Communication with devices for details.

Default installation is configured to detect autopilot automatically on any available serial port at 57600 or 115Kbps.

Model name and serial number override


• Name: vehicle.px4.custom.[name].system_id = [system id]

• Name: vehicle.px4.custom.[name].model_name = [model name]

Configuration file

Name: vehicle.px4.custom.[name].serial_number = [serial number]

Description: In UgCS each vehicle is identified by a unique combination of model name and serial number represented as text strings. By default, PX4 vehicles are identified with a model name PX4 and serial number equal with the Mavlink system id read from the vehicle. It can be overridden by these parameters, where [name] is an arbitrary vehicle name, [system id] is the original Mavlink system id which should be overridden, [model name] is a new model name to be visible to the UgCS, [serial number] is a new serial number to be visible to the UgCS.

vehicle.px4.custom.my_drone.system_id = 2
vehicle.px4.custom.my_drone.model_name = PX4Quad
vehicle.px4.custom.my_drone.serial_number = 123456

Camera trigger type

There are different ways to control camera payload in px4 family. First one is "common" one and utilizes SET_SERVO or REPEAT_SERVO commands. Camera trigger control is linked with autopilot servo output and triggering take place when we send proper amount of PWM signal in that output.

Second one is when we use high level commands MAV_CMD_IMAGE_START_CAPTURE and MAV_CMD_IMAGE_STOP_CAPTURE to control triggering.
So we introduce parameter


When it set to 0, VSM will use high level commands MAV_CMD_IMAGE_START_CAPTURE and MAV_CMD_IMAGE_STOP_CAPTURE And when it set to 1 - VSM will use MAV_CMD_DO_REPEAT_SERVO command along with camera_servo_idx, camera_servo_pwm and camera_servo_time parameter values.

Note: Yuneec 520 with payload always override this parameter to 0 value.

Telemetry rate configuration

PX4 VSM supports setting custom telemetry rates based on mavlink message type. There are 8 message types which are used by VSM to get the essential state info from vehicle: SYS_STATUS, GLOBAL_POSITION_INT, ATTITUDE, VFR_HUD, GPS_RAW_INT, ALTITUDE, HEARTBEAT, HOME_POSITION.

Other messages which are sent by autopilot are disabled by VSM to save datalink channel bandwidth.

It is possible to configure rate for each message type separately.

• Required: No.

• Supported values: 0.1 - 50.0

• Default: 2

• Description: Message count per second.

• Example:

vehicle.px4.telemetry_rate.ALTITUDE = 0.5
vehicle.px4.telemetry_rate.ATTITUDE = 0.5
vehicle.px4.telemetry_rate.GLOBAL_POSITION_INT = 0.5
vehicle.px4.telemetry_rate.GPS_RAW_INT = 0.5
vehicle.px4.telemetry_rate.HEARTBEAT = 0.5
vehicle.px4.telemetry_rate.HOME_POSITION = 0.5
vehicle.px4.telemetry_rate.SYS_STATUS = 0.5
vehicle.px4.telemetry_rate.VFR_HUD = 0.5

Mavlink version

PX4 VSM supports MAVLink versions 1 and 2 and detects the correct version automatically. In setups when there is some intermediate device between VSM and autopilot this detection can fail. For those scenarios it is possible to force mavlink version used by VSM.

• Required: No.

• Supported values: 1 2 auto

• Default: auto

• Description: 1: always use mavlink version 1, 2: always use mavlink version 2, auto: Autodetect mavlink version.

• Example:

vehicle.px4.mavlink_protocol_version = 1

Force heading to next WP

By default VSM will automatically generate commands for vehicle to set heading towards next waypoint. This behavior can be disabled by setting parameter "autoheading" to no. See also Heading behavior

• Required: No.

• Supported values: yes, no

• Default: yes

• Description:

no - do not change heading between waypoints. This disables override of parameter MIS_YAWMODE on mission upload. Vehicle heading will depend on MIS_YAWMODE. If MIS_YAWMODE is set to 1 (next WP) then all heading actions in mission will be ignored.

yes - change heading towards next waypoint. When set, each mission upload sets MIS_YAWMODE to zero (yaw controlled by mission)

• Example:

vehicle.px4.autoheading = no

Mavlink message injection

Ardupilot VSM can receive mavlink packets and forward them to the vehicle if vehicle with specified target_id is connected. It can be used to send GPS RTK corrections to vehicles. If message has no target_id or traget_id is 0 then it is sent to all connected vehicles. Supported messages are: COMMAND_LONG, COMMAND_INT, GPS_INJECT_DATA and GPS_RTCM_DATA. The prefix mavlink_injection supports all the same syntax as "connection" prefix.

• Required: No.

• Supported values: Same as those for connection prefix.

• Default: Not set.

• Example: mavlink_injection.udp_any.1.local_port = 44444

Mavlink System ID

MAVlink System ID used for outgoing MAVlink messages.

• Required: No.

• Supported values: 1 - 254

• Default: 1.

• Example:

mavlink.vsm_system_id = 100