Skip to content

Commit

Permalink
need to switch to odid-scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
xiemengjie-kay committed Jan 30, 2024
1 parent 106948b commit f594009
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
19 changes: 18 additions & 1 deletion libraries/AP_ODIDScanner/AP_ODIDScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void AP_ODIDScanner::init() {
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "RID: Unable to initialize RID vehicle list");
return;
}
in_state.list_size_allocated = in_state.list_size_param;
in_state.list_size_allocated = in_state.list_size_param;
}
}

Expand Down Expand Up @@ -188,3 +188,20 @@ Location AP_ODIDScanner::get_location(rid_vehicle_t &vehicle) {
Location::AltFrame::ABSOLUTE);
return loc;
}

/*
* Copy a vehicle's data into the list
*/
void AP_ADSB::set_vehicle(const uint16_t index, const rid_vehicle_t &vehicle)
{
if (index >= in_state.list_size_allocated) {
// out of range
return;
}
in_state.vehicle_list[index] = vehicle;

// TODO: write_log method required
// #if HAL_LOGGING_ENABLED
// write_log(vehicle);
// #endif
}
4 changes: 4 additions & 0 deletions libraries/AP_ODIDScanner/AP_ODIDScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class AP_ODIDScanner
uint32_t send_start_ms[MAVLINK_COMM_NUM_BUFFERS];
uint16_t send_index[MAVLINK_COMM_NUM_BUFFERS];
} in_state;

uint8_t detected_num_instances;

This comment has been minimized.

Copy link
@shipp02

shipp02 Feb 1, 2024

What is this?


static const uint8_t _max_samples = 30;
ObjectBuffer<rid_vehicle_t> _samples{_max_samples};

Expand All @@ -103,6 +106,7 @@ class AP_ODIDScanner
void update_collide();
Location get_location(const rid_vehicle_t &vehicle);
void delete_vehicle(const uint16_t index);
void set_vehicle(const uint16_t index, const rid_vehicle_t &vehicle);
void handle_msg(mavlink_message_t);
// mavlink_channel_t _chan; // mavlink channel that communicates with the remote id transceiver
uint8_t _mav_port;
Expand Down

0 comments on commit f594009

Please sign in to comment.