PX4 Firmware
PX4 Autopilot Software http://px4.io
|
replay specialization for Ekf2 replay More...
#include <ReplayEkf2.hpp>
Protected Member Functions | |
void | onEnterMainLoop () override |
called when entering the main replay loop More... | |
void | onExitMainLoop () override |
called when exiting the main replay loop More... | |
uint64_t | handleTopicDelay (uint64_t next_file_time, uint64_t timestamp_offset) override |
handle delay until topic can be published. More... | |
bool | handleTopicUpdate (Subscription &sub, void *data, std::ifstream &replay_file) override |
handle ekf2 topic publication in ekf2 replay mode More... | |
void | onSubscriptionAdded (Subscription &sub, uint16_t msg_id) override |
called when a new subscription is added More... | |
Protected Member Functions inherited from px4::Replay | |
bool | publishTopic (Subscription &sub, void *data) |
publish an orb topic More... | |
void | readTopicDataToBuffer (const Subscription &sub, std::ifstream &replay_file) |
read a topic from the file (offset given by the subscription) into _read_buffer More... | |
bool | nextDataMessage (std::ifstream &file, Subscription &subscription, int msg_id) |
Find next data message for this subscription, starting with the stored file offset. More... | |
Private Member Functions | |
bool | publishEkf2Topics (const ekf2_timestamps_s &ekf2_timestamps, std::ifstream &replay_file) |
bool | findTimestampAndPublish (uint64_t timestamp, uint16_t msg_id, std::ifstream &replay_file) |
find the next message for a subscription that matches a given timestamp and publish it More... | |
Private Attributes | |
int | _vehicle_attitude_sub = -1 |
uint16_t | _airspeed_msg_id = msg_id_invalid |
uint16_t | _distance_sensor_msg_id = msg_id_invalid |
uint16_t | _gps_msg_id = msg_id_invalid |
uint16_t | _optical_flow_msg_id = msg_id_invalid |
uint16_t | _sensor_combined_msg_id = msg_id_invalid |
uint16_t | _vehicle_air_data_msg_id = msg_id_invalid |
uint16_t | _vehicle_magnetometer_msg_id = msg_id_invalid |
uint16_t | _vehicle_visual_odometry_msg_id = msg_id_invalid |
int | _topic_counter = 0 |
Static Private Attributes | |
static constexpr uint16_t | msg_id_invalid = 0xffff |
Additional Inherited Members | |
Public Member Functions inherited from px4::Replay | |
Replay ()=default | |
virtual | ~Replay () |
void | run () override |
Static Public Member Functions inherited from px4::Replay | |
static int | task_spawn (int argc, char *argv[]) |
static Replay * | instantiate (int argc, char *argv[]) |
static int | custom_command (int argc, char *argv[]) |
static int | print_usage (const char *reason=nullptr) |
static int | applyParams (bool quiet) |
Apply the parameters from the log. More... | |
static void | setupReplayFile (const char *file_name) |
Tell the replay module that we want to use replay mode. More... | |
static bool | isSetup () |
Static Protected Member Functions inherited from px4::Replay | |
static bool | findFieldOffset (const std::string &format, const std::string &field_name, int &offset, int &field_size) |
Find the offset & field size in bytes for a given field name. More... | |
Protected Attributes inherited from px4::Replay | |
std::vector< Subscription * > | _subscriptions |
std::vector< uint8_t > | _read_buffer |
replay specialization for Ekf2 replay
Definition at line 45 of file ReplayEkf2.hpp.
|
private |
find the next message for a subscription that matches a given timestamp and publish it
timestamp | in 0.1 ms |
msg_id | |
replay_file | file currently replayed (file seek position should be considered arbitrary after this call) |
Definition at line 182 of file ReplayEkf2.cpp.
References px4::Replay::_read_buffer, px4::Replay::_subscriptions, px4::Replay::Subscription::error_counter, msg_id_invalid, px4::Replay::Subscription::next_timestamp, px4::Replay::nextDataMessage(), orb_metadata::o_name, px4::Replay::Subscription::orb_meta, px4::Replay::publishTopic(), and px4::Replay::readTopicDataToBuffer().
Referenced by publishEkf2Topics().
|
overrideprotectedvirtual |
handle delay until topic can be published.
next_file_timestamp | timestamp of next message to publish |
timestamp_offset | offset between file start time and replay start time |
Reimplemented from px4::Replay.
Definition at line 249 of file ReplayEkf2.cpp.
|
overrideprotectedvirtual |
handle ekf2 topic publication in ekf2 replay mode
sub | |
data | |
replay_file | file currently replayed (file seek position should be considered arbitrary after this call) |
Reimplemented from px4::Replay.
Definition at line 59 of file ReplayEkf2.cpp.
References _topic_counter, _vehicle_attitude_sub, orb_metadata::o_size, orb_copy(), ORB_ID, px4::Replay::Subscription::orb_meta, publishEkf2Topics(), px4::Replay::publishTopic(), and px4_poll().
|
overrideprotectedvirtual |
called when entering the main replay loop
Reimplemented from px4::Replay.
Definition at line 213 of file ReplayEkf2.cpp.
References _vehicle_attitude_sub, ORB_ID, and orb_subscribe().
|
overrideprotectedvirtual |
called when exiting the main replay loop
Reimplemented from px4::Replay.
Definition at line 219 of file ReplayEkf2.cpp.
References _airspeed_msg_id, _distance_sensor_msg_id, _gps_msg_id, _optical_flow_msg_id, _sensor_combined_msg_id, px4::Replay::_subscriptions, _vehicle_air_data_msg_id, _vehicle_attitude_sub, _vehicle_magnetometer_msg_id, _vehicle_visual_odometry_msg_id, px4::Replay::Subscription::error_counter, msg_id_invalid, name, orb_unsubscribe(), and px4::Replay::Subscription::publication_counter.
|
overrideprotectedvirtual |
called when a new subscription is added
Reimplemented from px4::Replay.
Definition at line 107 of file ReplayEkf2.cpp.
References _airspeed_msg_id, _distance_sensor_msg_id, _gps_msg_id, _optical_flow_msg_id, _sensor_combined_msg_id, _vehicle_air_data_msg_id, _vehicle_magnetometer_msg_id, _vehicle_visual_odometry_msg_id, px4::Replay::Subscription::ignored, px4::Replay::Subscription::multi_id, ORB_ID, and px4::Replay::Subscription::orb_meta.
|
private |
Definition at line 144 of file ReplayEkf2.cpp.
References _airspeed_msg_id, _distance_sensor_msg_id, _gps_msg_id, _optical_flow_msg_id, px4::Replay::_read_buffer, _sensor_combined_msg_id, px4::Replay::_subscriptions, _vehicle_air_data_msg_id, _vehicle_magnetometer_msg_id, _vehicle_visual_odometry_msg_id, ekf2_timestamps_s::airspeed_timestamp_rel, ekf2_timestamps_s::distance_sensor_timestamp_rel, findTimestampAndPublish(), ekf2_timestamps_s::gps_timestamp_rel, msg_id_invalid, ekf2_timestamps_s::optical_flow_timestamp_rel, px4::Replay::publishTopic(), px4::Replay::readTopicDataToBuffer(), ekf2_timestamps_s::timestamp, ekf2_timestamps_s::vehicle_air_data_timestamp_rel, ekf2_timestamps_s::vehicle_magnetometer_timestamp_rel, and ekf2_timestamps_s::visual_odometry_timestamp_rel.
Referenced by handleTopicUpdate().
|
private |
Definition at line 83 of file ReplayEkf2.hpp.
Referenced by onExitMainLoop(), onSubscriptionAdded(), and publishEkf2Topics().
|
private |
Definition at line 84 of file ReplayEkf2.hpp.
Referenced by onExitMainLoop(), onSubscriptionAdded(), and publishEkf2Topics().
|
private |
Definition at line 85 of file ReplayEkf2.hpp.
Referenced by onExitMainLoop(), onSubscriptionAdded(), and publishEkf2Topics().
|
private |
Definition at line 86 of file ReplayEkf2.hpp.
Referenced by onExitMainLoop(), onSubscriptionAdded(), and publishEkf2Topics().
|
private |
Definition at line 87 of file ReplayEkf2.hpp.
Referenced by onExitMainLoop(), onSubscriptionAdded(), and publishEkf2Topics().
|
private |
Definition at line 92 of file ReplayEkf2.hpp.
Referenced by handleTopicUpdate().
|
private |
Definition at line 88 of file ReplayEkf2.hpp.
Referenced by onExitMainLoop(), onSubscriptionAdded(), and publishEkf2Topics().
|
private |
Definition at line 79 of file ReplayEkf2.hpp.
Referenced by handleTopicUpdate(), onEnterMainLoop(), and onExitMainLoop().
|
private |
Definition at line 89 of file ReplayEkf2.hpp.
Referenced by onExitMainLoop(), onSubscriptionAdded(), and publishEkf2Topics().
|
private |
Definition at line 90 of file ReplayEkf2.hpp.
Referenced by onExitMainLoop(), onSubscriptionAdded(), and publishEkf2Topics().
|
staticprivate |
Definition at line 81 of file ReplayEkf2.hpp.
Referenced by findTimestampAndPublish(), onExitMainLoop(), and publishEkf2Topics().