Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AntennaTracker/GCS_MAVLink_Tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ void GCS_MAVLINK_Tracker::packetReceived(const mavlink_status_t &status,
const mavlink_message_t &msg)
{
// return immediately if sysid doesn't match our target sysid
if ((tracker.g.sysid_target != 0) && (tracker.g.sysid_target != msg.sysid)) {
if ((tracker.g.sysid_target != 0) && (uint32_t(tracker.g.sysid_target.get()) != msg.sysid)) {
GCS_MAVLINK::packetReceived(status, msg);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions AntennaTracker/GCS_Tracker.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "GCS_Tracker.h"
#include "Tracker.h"

void GCS_Tracker::request_datastream_position(const uint8_t _sysid, const uint8_t compid)
void GCS_Tracker::request_datastream_position(const uint32_t _sysid, const uint8_t compid)
{
for (uint8_t i=0; i < num_gcs(); i++) {
// request position
Expand All @@ -17,7 +17,7 @@ void GCS_Tracker::request_datastream_position(const uint8_t _sysid, const uint8_
}
}

void GCS_Tracker::request_datastream_airpressure(const uint8_t _sysid, const uint8_t compid)
void GCS_Tracker::request_datastream_airpressure(const uint32_t _sysid, const uint8_t compid)
{
for (uint8_t i=0; i < num_gcs(); i++) {
// request air pressure
Expand Down
4 changes: 2 additions & 2 deletions AntennaTracker/GCS_Tracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class GCS_Tracker : public GCS

private:

void request_datastream_position(uint8_t sysid, uint8_t compid);
void request_datastream_airpressure(uint8_t sysid, uint8_t compid);
void request_datastream_position(uint32_t sysid, uint8_t compid);
void request_datastream_airpressure(uint32_t sysid, uint8_t compid);

};
2 changes: 1 addition & 1 deletion AntennaTracker/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const AP_Param::Info Tracker::var_info[] = {
// @Param: SYSID_TARGET
// @DisplayName: Target vehicle's MAVLink system ID
// @Description: The identifier of the vehicle being tracked. This should be zero (to auto detect) or be the same as the MAV_SYSID parameter of the vehicle being tracked.
// @Range: 1 255
// @Range: 1 16777215
// @User: Advanced
GSCALAR(sysid_target, "SYSID_TARGET", 0),

Expand Down
2 changes: 1 addition & 1 deletion AntennaTracker/Parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class Parameters {

// Telemetry control
//
AP_Int16 sysid_target;
AP_Int32 sysid_target;

AP_Float yaw_slew_time;
AP_Float pitch_slew_time;
Expand Down
3 changes: 3 additions & 0 deletions AntennaTracker/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ static const StorageAccess wp_storage(StorageManager::StorageMission);

void Tracker::init_ardupilot()
{
// PARAMETER_CONVERSION - Added: Jul-2026 for 32 bit sysids
g.sysid_target.convert_parameter_width(AP_PARAM_INT16);

// initialise notify
notify.init();
AP_Notify::flags.pre_arm_check = true;
Expand Down
5 changes: 5 additions & 0 deletions ArduCopter/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,11 @@ void Copter::load_parameters(void)
copter.avoid.convert_params();
#endif

#if MODE_FOLLOW_ENABLED
// convert Follow parameters
copter.g2.follow.convert_params();
#endif

// convert PILOT vertical speed and acceleration parameters
// PARAMETER_CONVERSION - Added: Feb 2026 for ardupilot-4.7
{
Expand Down
8 changes: 5 additions & 3 deletions ArduPlane/GCS_MAVLink_Plane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,13 +746,15 @@ MAV_RESULT GCS_MAVLINK_Plane::handle_command_int_packet(const mavlink_command_in
#endif

#if AP_SCRIPTING_ENABLED && AP_FOLLOW_ENABLED
case MAV_CMD_DO_FOLLOW:
case MAV_CMD_DO_FOLLOW: {
// param1: sysid of target to follow
if ((packet.param1 > 0) && (packet.param1 <= 255)) {
plane.g2.follow.set_target_sysid((uint8_t)packet.param1);
const int64_t sysid = (int64_t)packet.param1;
if (sysid > 0 && sysid <= (int64_t)0xFFFFFFFF) {
plane.g2.follow.set_target_sysid((uint32_t)sysid);
return MAV_RESULT_ACCEPTED;
}
return MAV_RESULT_DENIED;
}
#endif

#if AP_ICENGINE_ENABLED
Expand Down
5 changes: 5 additions & 0 deletions ArduPlane/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1478,6 +1478,11 @@ void Plane::load_parameters(void)

g.use_reverse_thrust.convert_parameter_width(AP_PARAM_INT16);

#if AP_SCRIPTING_ENABLED && AP_FOLLOW_ENABLED
// convert Follow parameters
g2.follow.convert_params();
#endif

// PARAMETER_CONVERSION - Added: Jun-2026 for FBWB_CLIMB_RATE width change
g.flybywire_climb_rate.convert_parameter_width(AP_PARAM_INT8);

Expand Down
5 changes: 5 additions & 0 deletions Rover/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,11 @@ void Rover::load_parameters(void)
};
AP_Param::convert_old_parameters(&ff_and_filt_conversion_info[0], ARRAY_SIZE(ff_and_filt_conversion_info));

#if AP_FOLLOW_ENABLED
// convert Follow parameters
g2.follow.convert_params();
#endif

// configure safety switch to allow stopping the motors while armed
#if HAL_HAVE_SAFETY_SWITCH
AP_Param::set_default_by_name("BRD_SAFETYOPTION", AP_BoardConfig::BOARD_SAFETY_OPTION_BUTTON_ACTIVE_SAFETY_OFF|
Expand Down
2 changes: 1 addition & 1 deletion Rover/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ void ModeAuto::send_guided_position_target()
guided_target.last_sent_ms = now_ms;

// get system id and component id of offboard navigation system
uint8_t sysid;
uint32_t sysid;
uint8_t compid;
mavlink_channel_t chan;
if (GCS_MAVLINK::find_by_mavtype(MAV_TYPE_ONBOARD_CONTROLLER, sysid, compid, chan)) {
Expand Down
6 changes: 5 additions & 1 deletion Tools/AP_Periph/adsb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ void AP_Periph_FW::adsb_update(void)
&adsb.status,
&msg, &heartbeat);

uart->write((uint8_t*)&msg.magic, len);
uint8_t msgbuf[len];
len = mavlink_msg_to_send_buffer(msgbuf, &msg);
if (len > 0) {
uart->write(msgbuf, len);
}
}
}

Expand Down
65 changes: 65 additions & 0 deletions Tools/autotest/rover.py
Original file line number Diff line number Diff line change
Expand Up @@ -6663,6 +6663,70 @@ def TestWebServer(self, url):

self.progress("WebServer tests OK")

def MAV_SYSID_32bit(self):
'''test 32 bit MAV_SYSID'''
if not hasattr(mavutil.mavlink, "MAVLINK_IFLAG_SYSID32"):
raise NotAchievedException("pymavlink is too old for 32 bit system IDs")

# sysid values must round-trip losslessly through the float32
# parameter transport, so stay below 2^24 for now
sysid = 100000
self.set_parameter("MAV_SYSID", sysid)

# the sysid changes across the reboot so we can't use
# reboot_sitl(); send the reboot at the old sysid and re-point
# the connection at the new one
self.send_reboot_command()
self.mav.target_system = sysid
self.sysid_thismav = lambda: sysid
try:
self.wait_heartbeat(timeout=60)
m = self.wait_heartbeat()
if m.get_srcSystem() != sysid:
raise NotAchievedException("Did not get 32 bit sysid, got %u" % m.get_srcSystem())
hdr = m.get_header()
if not (hdr.incompat_flags & mavutil.mavlink.MAVLINK_IFLAG_SYSID32):
raise NotAchievedException("expected MAVLINK_IFLAG_SYSID32 to be set")

# parameter fetch at the new sysid
if int(self.get_parameter("MAV_SYSID")) != sysid:
raise NotAchievedException("MAV_SYSID readback failed")

# our own GCS with a 32 bit source system, and a targeted
# message each way
mav2 = mavutil.mavlink_connection(
"tcp:localhost:%u" % self.adjust_ardupilot_port(5763),
robust_parsing=True,
source_system=70000,
source_component=7,
)
mav2.mav.param_request_read_send(sysid, 1, b"MAV_SYSID", -1)
m = mav2.recv_match(type='PARAM_VALUE', blocking=True, timeout=10)
if m is None:
raise NotAchievedException("no PARAM_VALUE for 32 bit source system")
if m.param_id != "MAV_SYSID" or int(m.param_value) != sysid:
raise NotAchievedException("bad PARAM_VALUE %s" % str(m))
mav2.close()

# targeted mission-protocol round trip (the mission upload
# helpers hard-code target system 1, so do this by hand)
self.mav.mav.mission_request_list_send(sysid, 1, mavutil.mavlink.MAV_MISSION_TYPE_MISSION)
m = self.assert_receive_message('MISSION_COUNT', timeout=10)
if m.mission_type != mavutil.mavlink.MAV_MISSION_TYPE_MISSION:
raise NotAchievedException("bad MISSION_COUNT")

self.wait_ready_to_arm()
self.arm_vehicle()
self.disarm_vehicle()
finally:
# restore the old sysid
self.set_parameter("MAV_SYSID", 1)
self.send_reboot_command()
del self.sysid_thismav
self.mav.target_system = 1
self.wait_heartbeat(timeout=60)
self.wait_heartbeat()

def NetworkingWebServer(self):
'''web server'''
applet_script = "net_webserver.lua"
Expand Down Expand Up @@ -7553,6 +7617,7 @@ def tests(self):
self.MAV_CMD_BATTERY_RESET,
self.GPSForYaw,
self.NetworkingWebServer,
self.MAV_SYSID_32bit,
self.NetworkingWebServerPPP,
self.RTL_SPEED,
self.ScriptingLocationBindings,
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_AccelCal/AP_AccelCal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void AP_AccelCal::update()
}
}

void AP_AccelCal::start(GCS_MAVLINK *gcs, uint8_t sysid, uint8_t compid)
void AP_AccelCal::start(GCS_MAVLINK *gcs, uint32_t sysid, uint8_t compid)
{
if (gcs == nullptr || _started) {
return;
Expand Down Expand Up @@ -364,7 +364,7 @@ bool AP_AccelCal::client_active(uint8_t client_num)
}

#if HAL_GCS_ENABLED
void AP_AccelCal::handle_command_ack(const mavlink_command_ack_t &packet, uint8_t src_sysid, uint8_t src_compid)
void AP_AccelCal::handle_command_ack(const mavlink_command_ack_t &packet, uint32_t src_sysid, uint8_t src_compid)
{
if(_sysid != src_sysid || _compid != src_compid) {
return;
Expand Down
6 changes: 3 additions & 3 deletions libraries/AP_AccelCal/AP_AccelCal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class AP_AccelCal {
{ update_status(); }

// start all the registered calibrations
void start(GCS_MAVLINK *gcs, uint8_t sysid, uint8_t compid);
void start(GCS_MAVLINK *gcs, uint32_t sysid, uint8_t compid);

// called on calibration cancellation
void cancel();
Expand All @@ -46,15 +46,15 @@ class AP_AccelCal {
static void register_client(AP_AccelCal_Client* client);

#if HAL_GCS_ENABLED
void handle_command_ack(const mavlink_command_ack_t &packet, uint8_t src_sysid, uint8_t src_compid);
void handle_command_ack(const mavlink_command_ack_t &packet, uint32_t src_sysid, uint8_t src_compid);
#endif

// true if we are in a calibration process
bool running(void) const;

private:
class GCS_MAVLINK *_gcs;
uint8_t _sysid;
uint32_t _sysid;
uint8_t _compid;
bool _use_gcs_snoop;
bool _waiting_for_mavlink_ack = false;
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_BattMonitor/AP_BattMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ void AP_BattMonitor::checkPoweringOff(void)
cmd_msg.command = MAV_CMD_POWER_OFF_INITIATED;
cmd_msg.param1 = i+1;
GCS_MAVLINK::send_to_components(MAVLINK_MSG_ID_COMMAND_LONG, (char*)&cmd_msg, sizeof(cmd_msg));
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "Vehicle %d battery %d is powering off", mavlink_system.sysid, i+1);
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "Vehicle %u battery %d is powering off", (unsigned)mavlink_system.sysid, i+1);
#endif

// only send this once
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_CANManager/AP_MAVLinkCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void AP_MAVLinkCAN::_handle_can_filter_modify(const mavlink_message_t &msg)
void AP_MAVLinkCAN::can_frame_callback(uint8_t bus, const AP_HAL::CANFrame &frame, AP_HAL::CANIface::CanIOFlags flags)
{
mavlink_channel_t chan;
uint8_t system_id;
uint32_t system_id;
uint8_t component_id;
{
WITH_SEMAPHORE(can_forward.sem);
Expand Down
2 changes: 1 addition & 1 deletion libraries/AP_CANManager/AP_MAVLinkCAN.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class AP_MAVLinkCAN {
*/
struct {
mavlink_channel_t chan;
uint8_t system_id;
uint32_t system_id;
uint8_t component_id;
uint8_t frame_counter;
uint32_t last_callback_enable_ms;
Expand Down
20 changes: 10 additions & 10 deletions libraries/AP_Camera/AP_Camera_MAVLinkCamV2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ bool AP_Camera_MAVLinkCamV2::trigger_pic()

// prepare and send message
mavlink_command_long_t pkt {};
pkt.target_system = _sysid;
pkt.target_system = _sysid>255?0:_sysid; // targets > 255 travel in the extended header
pkt.target_component = _compid;
pkt.command = MAV_CMD_IMAGE_START_CAPTURE;
pkt.param3 = 1; // number of images to take
pkt.param4 = image_index+1; // starting sequence number

_link->send_message(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt);
_link->send_message_target(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt, _sysid, _compid);

return true;
}
Expand All @@ -51,7 +51,7 @@ bool AP_Camera_MAVLinkCamV2::record_video(bool start_recording)

// prepare and send message
mavlink_command_long_t pkt {};
pkt.target_system = _sysid;
pkt.target_system = _sysid>255?0:_sysid; // targets > 255 travel in the extended header
pkt.target_component = _compid;

if (start_recording) {
Expand All @@ -63,7 +63,7 @@ bool AP_Camera_MAVLinkCamV2::record_video(bool start_recording)
// param1 = 0, video stream id. 0 for all streams
}

_link->send_message(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt);
_link->send_message_target(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt, _sysid, _compid);

return true;
}
Expand All @@ -78,7 +78,7 @@ bool AP_Camera_MAVLinkCamV2::set_zoom(ZoomType zoom_type, float zoom_value)

// prepare and send message
mavlink_command_long_t pkt {};
pkt.target_system = _sysid;
pkt.target_system = _sysid>255?0:_sysid; // targets > 255 travel in the extended header
pkt.target_component = _compid;
pkt.command = MAV_CMD_SET_CAMERA_ZOOM;
switch (zoom_type) {
Expand All @@ -91,7 +91,7 @@ bool AP_Camera_MAVLinkCamV2::set_zoom(ZoomType zoom_type, float zoom_value)
}
pkt.param2 = zoom_value; // Zoom Value

_link->send_message(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt);
_link->send_message_target(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt, _sysid, _compid);

return true;
}
Expand All @@ -107,7 +107,7 @@ SetFocusResult AP_Camera_MAVLinkCamV2::set_focus(FocusType focus_type, float foc

// prepare and send message
mavlink_command_long_t pkt {};
pkt.target_system = _sysid;
pkt.target_system = _sysid>255?0:_sysid; // targets > 255 travel in the extended header
pkt.target_component = _compid;
pkt.command = MAV_CMD_SET_CAMERA_FOCUS;
switch (focus_type) {
Expand All @@ -126,7 +126,7 @@ SetFocusResult AP_Camera_MAVLinkCamV2::set_focus(FocusType focus_type, float foc
}
pkt.param2 = focus_value;

_link->send_message(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt);
_link->send_message_target(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt, _sysid, _compid);

return SetFocusResult::ACCEPTED;
}
Expand Down Expand Up @@ -242,12 +242,12 @@ void AP_Camera_MAVLinkCamV2::request_camera_information() const
0, // param6
0, // param7
MAV_CMD_REQUEST_MESSAGE,
_sysid,
uint8_t(_sysid>255?0:_sysid), // targets > 255 travel in the extended header
_compid,
0 // confirmation
};

_link->send_message(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt);
_link->send_message_target(MAVLINK_MSG_ID_COMMAND_LONG, (const char*)&pkt, _sysid, _compid);
}

#endif // AP_CAMERA_MAVLINKCAMV2_ENABLED
2 changes: 1 addition & 1 deletion libraries/AP_Camera/AP_Camera_MAVLinkCamV2.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AP_Camera_MAVLinkCamV2 : public AP_Camera_Backend
mavlink_camera_information_t _cam_info {}; // latest camera information received from camera
uint32_t _last_caminfo_req_ms; // system time that CAMERA_INFORMATION was last requested (used to throttle requests)
class GCS_MAVLINK *_link; // link we have found the camera on. nullptr if not seen yet
uint8_t _sysid; // sysid of camera
uint32_t _sysid; // sysid of camera
uint8_t _compid; // component id of gimbal
};

Expand Down
Loading
Loading