25 #include <libkern/OSByteOrder.h> 26 #define htobe64(x) OSSwapHostToBigInt64(x) 32 #if defined(__linux__) || defined(__APPLE__) 35 return _byteswap_uint64(val);
44 #define SENSOR_TYPE_POS (0) 45 #define SENSOR_TYPE_MASK (0x001F << SENSOR_TYPE_POS) 46 #define SENSOR_INDEX_POS (5) 47 #define SENSOR_INDEX_MASK (0x0007 << SENSOR_INDEX_POS) 48 #define SET_SENSOR_ID(_type, _index) ((((_type) << SENSOR_TYPE_POS) & SENSOR_TYPE_MASK) | (((_index) << SENSOR_INDEX_POS) & SENSOR_INDEX_MASK)) 49 #define GET_SENSOR_INDEX(_sensorID) ((_sensorID & SENSOR_INDEX_MASK) >> SENSOR_INDEX_POS) 50 #define GET_SENSOR_TYPE(_sensorID) ((_sensorID & SENSOR_TYPE_MASK) >> SENSOR_TYPE_POS) 54 #define ENDPOINT_DEV_IN 0 55 #define ENDPOINT_DEV_OUT 0 56 #define ENDPOINT_DEV_MSGS_IN 1 57 #define ENDPOINT_DEV_MSGS_OUT 1 58 #define ENDPOINT_DEV_INT_IN 2 59 #define ENDPOINT_DEV_INT_OUT 2 64 #define ENDPOINT_HOST_IN (ENDPOINT_DEV_OUT + 1 + 0x80) 65 #define ENDPOINT_HOST_OUT (ENDPOINT_DEV_IN + 1) 66 #define ENDPOINT_HOST_MSGS_IN (ENDPOINT_DEV_MSGS_OUT + 1 + 0x80) 67 #define ENDPOINT_HOST_MSGS_OUT (ENDPOINT_DEV_MSGS_IN + 1) 68 #define ENDPOINT_HOST_INT_IN (ENDPOINT_DEV_INT_OUT + 1 + 0x80) 69 #define ENDPOINT_HOST_INT_OUT (ENDPOINT_DEV_INT_IN + 1) 82 #define FREE_CONT 0x8001 155 float query()
const override {
return _ep.get_temperature(_type).fTemperature; }
162 _range(
option_range{ 0, _ep.get_temperature(_type).fThreshold, 0, 0 }) { }
173 float query()
const override {
return _ep.get_exposure(); }
175 void set(
float value)
override {
return _ep.set_exposure(
value); }
191 float query()
const override {
return !_ep.is_manual_exposure(); }
193 void set(
float value)
override {
return _ep.set_manual_exposure(1.
f -
value); }
211 return _ep.get_gain();
216 return _ep.set_gain(
value);
230 template <SIXDOF_MODE flag, SIXDOF_MODE depends_on,
bool invert = false>
234 float query()
const override {
return !!(
s._tm_mode & flag) ^
invert ? 1 : 0; }
238 throw io_exception(
"Option is read-only while streaming");
239 s._tm_mode = (!!
value ^
invert) ? (
s._tm_mode | flag) : (
s._tm_mode & ~flag);
244 bool is_enabled()
const override {
return !depends_on || (
s._tm_mode & depends_on) ?
true :
false; }
261 return "Current T265 Asic Temperature (degree celsius)";
272 return "Current T265 IMU Temperature (degree celsius)";
285 if (
auto* vf = dynamic_cast<const video_frame*>(&frm))
296 if (
auto* vf = dynamic_cast<const video_frame*>(&frm))
300 if (
auto* mf = dynamic_cast<const motion_frame*>(&frm))
304 if (
auto* pf = dynamic_cast<const pose_frame*>(&frm))
311 if (
auto* vf = dynamic_cast<const video_frame*>(&frm))
315 if (
auto* mf = dynamic_cast<const motion_frame*>(&frm))
319 if (
auto* pf = dynamic_cast<const pose_frame*>(&frm))
326 if (
auto* mf = dynamic_cast<const motion_frame*>(&frm))
339 return dynamic_cast<const video_frame*
>(&frm) !=
nullptr;
343 return dynamic_cast<const motion_frame*
>(&frm) !=
nullptr;
347 return dynamic_cast<const video_frame*
>(&frm) !=
nullptr || dynamic_cast<const motion_frame*>(&frm) !=
nullptr;
351 return (dynamic_cast<const video_frame*>(&frm) !=
nullptr) || (dynamic_cast<const motion_frame*>(&frm) !=
nullptr) || (dynamic_cast<const pose_frame*>(&frm) !=
nullptr);
360 :
sensor_base(
"Tracking Module", owner, this), _device(owner)
386 last_ts = { std::chrono::duration<double, std::milli>(0) };
426 LOG_ERROR(
"An error has occurred while disposing the sensor!");
436 std::map<uint8_t, std::shared_ptr<stream_profile_interface> > profile_map;
448 for(
int i = 0;
i < response->wNumSupportedStreams;
i++) {
449 auto tm_stream = response->stream[
i];
455 LOG_ERROR(
"Fisheye with sensor id > 1: " << sensor_id);
462 auto profile = std::make_shared<video_stream_profile>(
p);
464 profile->set_stream_type(stream);
465 profile->set_stream_index(sensor_id + 1);
475 profile_map[tm_stream.bSensorID] =
profile;
477 LOG_INFO(
"Added a fisheye sensor id: " << sensor_id);
482 LOG_ERROR(sensor_str <<
" with sensor id != 0: " << sensor_id);
489 LOG_DEBUG(
"Skipping gyro FPS " << tm_stream.wFramesPerSecond);
493 LOG_DEBUG(
"Skipping accel FPS " << tm_stream.wFramesPerSecond);
497 profile->set_stream_type(stream);
498 profile->set_stream_index(sensor_id);
500 profile->set_framerate(tm_stream.wFramesPerSecond);
507 profile_map[tm_stream.bSensorID] =
profile;
509 LOG_INFO(
"Added a " << sensor_str <<
" sensor id: " << sensor_id <<
" at " << tm_stream.wFramesPerSecond <<
"Hz");
512 LOG_INFO(
"Skipped a velocimeter stream");
519 LOG_ERROR(
"Found a pose stream but should not have one here");
527 LOG_ERROR(
"Invalid stream type " << sensor_type <<
" with sensor id: " << sensor_id);
543 profile->set_framerate(pose_fps);
548 auto reference_profile =
profile;
559 auto accel_it = std::find_if(results.begin(), results.end(),
560 [](std::shared_ptr<stream_profile_interface> spi) {
return RS2_STREAM_ACCEL == spi->get_stream_type(); });
561 auto gyro_it = std::find_if(results.begin(), results.end(),
562 [](std::shared_ptr<stream_profile_interface> spi) {
return RS2_STREAM_GYRO == spi->get_stream_type(); });
563 if ((accel_it != results.end()) && (gyro_it != results.end()))
585 auto& loopback_sensor =
_loopback->get_sensor(0);
587 loopback_sensor.open(loopback_sensor.get_stream_profiles());
596 for (
auto&&
r : requests) {
598 int stream_index = sp.
index;
602 LOG_INFO(
"Request for stream type " <<
r->get_stream_type() <<
" with stream index " << stream_index);
605 if(stream_index != 0)
616 tm_profile.wFramesPerSecond == sp.fps) {
619 (tm_profile.wWidth == sp.width && tm_profile.wHeight == sp.height &&
625 tm_profile.bOutputMode = 1;
634 int fisheye_streams = 0;
639 if(fisheye_streams == 1)
643 for(
auto p : _active_raw_streams)
647 LOG_INFO(
"Activated " << num_active <<
"/" << _active_raw_streams.size() + 1 <<
" streams");
653 request->wNumEnabledStreams =
uint32_t(_active_raw_streams.size());
657 for(
int i = 0;
i < 5;
i++) {
661 std::this_thread::sleep_for(std::chrono::seconds(1));
664 throw io_exception(
"open(...) failed. Invalid stream request packet");
666 throw io_exception(
"open(...) failed. Invalid stream specification");
699 auto& loopback_sensor =
_loopback->get_sensor(0);
700 loopback_sensor.close();
833 auto& loopback_sensor =
_loopback->get_sensor(0);
840 loopback_sensor.start(file_frames_callback);
854 auto& loopback_sensor =
_loopback->get_sensor(0);
855 loopback_sensor.stop();
879 int rs2_index = profile.
index;
952 if(stream_index != 0 && stream_index != 1)
984 for (
auto i : { 0,3,6,1,4,7,2,5,8 }) { *dst_rotation++ =
src.rotation[
i]; }
1008 auto& H_fe1_fe2 =
extr;
1009 auto H_fe2_fe1 =
inv(H_fe1_fe2);
1011 auto H_fe2_pose =
mult(H_fe2_fe1, H_fe1_pose);
1077 auto frame_holder_ptr = std::make_shared<frame_holder>();
1089 static unsigned long long frame_num = 0;
1095 frame_additional_data additional_data(ts.device_ts.count(), frame_num++, ts.arrival_ts.count(),
sizeof(frame_md), (
uint8_t*)&frame_md, ts.global_ts.count(), 0, 0,
false);
1098 std::shared_ptr<stream_profile_interface>
profile =
nullptr;
1103 p->get_stream_index() == 0)
1109 if (profile ==
nullptr)
1135 LOG_INFO(
"Dropped frame. alloc_frame(...) returned nullptr");
1145 LOG_WARNING(
"Frame received with streaming inactive");
1158 LOG_WARNING(
"Frame received with streaming inactive");
1171 LOG_WARNING(
"Frame received with streaming inactive");
1195 std::shared_ptr<stream_profile_interface>
profile =
nullptr;
1204 width = stride = video->get_width();
1205 height = video->get_height();
1209 if (profile ==
nullptr)
1218 if (delta_dev_ts < delta_dev_ts.zero())
1219 delta_dev_ts = -delta_dev_ts;
1221 if (delta_dev_ts < std::chrono::microseconds(1000))
1231 video->assign(width, height, stride,
bpp);
1240 LOG_INFO(
"Dropped frame. alloc_frame(...) returned nullptr");
1249 auto ts_nanos = duration<uint64_t, std::nano>(device_ns);
1250 result.
device_ts = duration<double, std::milli>(ts_nanos);
1263 uint32_t transferred = request->get_actual_length();
1264 if(transferred == 0) {
1265 LOG_ERROR(
"Interrupt transfer failed, exiting");
1281 LOG_ERROR(
"Did not expect to receive a velocimeter message");
1283 LOG_ERROR(
"Received DEV_SAMPLE with unknown type " << sensor_type);
1301 LOG_DEBUG(
"Got device stopped message");
1313 std::string msg =
to_string() <<
"T2xx: Relocalization occurred. id: " <<
event->wSessionId <<
", timestamp: " << ts.global_ts.count() <<
" ms";
1345 uint32_t transferred = request->get_actual_length();
1347 LOG_ERROR(
"Stream transfer failed, exiting");
1353 if (transferred !=
header->header.dwLength) {
1354 LOG_ERROR(
"Bulk received " << transferred <<
" but header was " <<
header->header.dwLength <<
" bytes (max_response_size was " <<
MAX_TRANSFER_SIZE <<
")");
1356 LOG_DEBUG(
"Got " << transferred <<
" on bulk stream endpoint");
1361 LOG_DEBUG(
"Got device stopped message");
1378 LOG_ERROR(
"Unexpected message on raw endpoint " <<
header->header.wMessageID);
1405 bool start_of_entry =
true;
1406 for (
size_t i = 0;
i < n_entries;
i++) {
1407 const auto &
e = entries[
i];
1409 memcpy(×tamp,
e.timestamp,
sizeof(
e.timestamp));
1410 LOG_INFO(
"T265 FW message: " << timestamp <<
": [0x" <<
e.threadID <<
"/" <<
e.moduleID <<
":" <<
e.lineNumber <<
"] " <<
e.payload);
1411 start_of_entry =
e.eventID ==
FREE_CONT ?
false :
true;
1436 std::this_thread::sleep_for(std::chrono::milliseconds(100));
1439 LOG_INFO(
"Got bad response, stopping log_poll");
1447 int tried_count = 0;
1455 LOG_INFO(
"Got bad response, stopping time sync");
1465 if (tried_count++ < 3)
continue;
1471 auto device = duration<double, std::milli>(device_ms);
1472 auto diff = duration<double, std::nano>(
start + usb_delay -
device);
1479 for(
int i = 0;
i < 10;
i++)
1481 std::this_thread::sleep_for(std::chrono::milliseconds(50));
1510 motion_md.temperature = temperature;
1514 std::shared_ptr<stream_profile_interface>
profile =
nullptr;
1518 if (
p->get_stream_type() == stream_type &&
1519 p->get_stream_index() ==
index)
1525 if (profile ==
nullptr)
1539 data[0] = imu_data[0];
1540 data[1] = imu_data[1];
1541 data[2] = imu_data[2];
1545 LOG_INFO(
"Dropped frame. alloc_frame(...) returned nullptr");
1554 event.timestamp = timestamp_ms;
1568 LOG_ERROR(
"Received SET_LOCALIZATION_DATA_COMPLETE while streaming");
1571 LOG_ERROR(
"Received SET_LOCALIZATION_DATA_COMPLETE without a transfer in progress");
1586 LOG_DEBUG(
"Received chunk " << chunk->
wIndex <<
" with status " << chunk->
wStatus <<
" length " << bytes);
1609 default:
return (
to_string() <<
" Unsupported type: " << val);
1614 std::function<
void()> on_success,
const std::string& op_description)
const 1616 std::mutex _async_op_lock;
1617 std::unique_lock<std::mutex>
lock(_async_op_lock);
1620 LOG_INFO(op_description <<
" in progress");
1622 bool start_success = transfer_activator();
1624 return async_op_state::_async_fail;
1626 if (!
_async_op.wait_for(lock, std::chrono::seconds(2), [
this] { return _async_op_status != _async_progress;}))
1627 LOG_WARNING(op_description <<
" aborted on timeout");
1644 bool interrupt_started =
sensor->start_interrupt();
1646 if (interrupt_started)
1647 sensor->stop_interrupt();
1649 bool stream_started =
sensor->start_stream();
1650 std::shared_ptr<void>
stop_stream(
nullptr, [&](...) {
1671 "Export localization map");
1673 if (res != async_op_state::_async_success)
1674 LOG_ERROR(
"Export localization map failed");
1676 return res == async_op_state::_async_success;
1687 bool interrupt_started =
sensor->start_interrupt();
1689 if (interrupt_started)
1690 sensor->stop_interrupt();
1692 bool stream_started =
sensor->start_stream();
1693 std::shared_ptr<void>
stop_stream(
nullptr, [&](...) {
1700 [
this, &lmap_buf]() {
1701 const int MAX_BIG_DATA_MESSAGE_LENGTH = 10250;
1703 size_t map_size = lmap_buf.size();
1704 std::unique_ptr<uint8_t []>
buf(
new uint8_t[MAX_BIG_DATA_MESSAGE_LENGTH]);
1707 if (map_size == 0)
return false;
1708 size_t left_length = map_size;
1709 int chunk_number = 0;
1710 while (left_length > 0) {
1714 if (left_length <= chunk_length) {
1715 chunk_size = left_length;
1719 message->wIndex = chunk_number;
1721 memcpy(
message->bPayload, lmap_buf.data() + (map_size - left_length), chunk_size);
1726 LOG_DEBUG(
"Sending chunk length " << chunk_size <<
" of map size " << map_size);
1732 "Import localization map");
1734 if (res != async_op_state::_async_success)
1735 LOG_ERROR(
"Import localization map failed");
1737 return res == async_op_state::_async_success;
1772 else if(response.header.wStatus !=
SUCCESS) {
1777 pos =
float3{response.data.flX, response.data.flY, response.data.flZ};
1778 orient_quat =
float4{response.data.flQi, response.data.flQj, response.data.flQk, response.data.flQr};
1792 else if(response.header.wStatus !=
SUCCESS) {
1801 std::vector<uint8_t>
buf;
1804 LOG_INFO(
"Sending wheel odometry with " << buf.size());
1808 strncpy((
char *)request.calibration_append_string, (
char *)odometry_config_buf.data(), bytes);
1857 for(
int i = 0;
i < 2;
i++) {
1870 throw std::runtime_error(
"To control exposure you must set sensor to manual exposure mode prior to streaming");
1884 throw std::runtime_error(
"To control gain you must set sensor to manual exposure mode prior to streaming");
1917 device(ctx, group, register_device_notifications)
1920 throw io_exception(
"Tried to create a T265 with a bad backend_device_group");
1929 const std::vector<platform::rs_usb_interface> interfaces =
usb_device->get_interfaces();
1930 for(
auto & iface : interfaces) {
1931 auto endpoints = iface->get_endpoints();
1932 for(
const auto & endpoint : endpoints) {
1933 int addr = endpoint->get_address();
1941 else LOG_ERROR(
"Unknown endpoint address " << addr);
1952 LOG_DEBUG(
"Successfully opened and claimed interface 0");
1959 throw io_exception(
"Unable to communicate with device");
1977 LOG_INFO(
"Firmware version: " << firmware);
1984 _sensor = std::make_shared<tm2_sensor>(
this);
2001 auto tm2_profiles =
_sensor->get_stream_profiles();
2002 for (
auto && pf : tm2_profiles)
2020 LOG_INFO(
"Sending hardware reset");
2025 template<
typename Request,
typename Response>
2032 uint16_t message_id = request.header.wMessageID;
2041 if (transferred != length) {
2042 LOG_ERROR(
"error: sent " << transferred <<
" not " << length);
2047 if(max_response_size == 0)
2048 max_response_size =
sizeof(response);
2049 LOG_DEBUG(
"Receiving message with max_response_size " << max_response_size);
2057 if (transferred != response.header.dwLength) {
2058 LOG_ERROR(
"Received " << transferred <<
" but header was " << response.header.dwLength <<
" bytes (max_response_size was " << max_response_size <<
")");
2062 LOG_ERROR(
"Received " <<
message_name(response.header) <<
" with length " << response.header.dwLength <<
" but got non-zero status of " <<
status_name(response.header));
2064 LOG_DEBUG(
"Received " <<
message_name(response.header) <<
" with length " << response.header.dwLength);
2083 if (transferred != length) {
2084 LOG_ERROR(
"error: sent " << transferred <<
" not " << length);
2093 request->set_buffer(buffer);
2094 request->set_callback(callback);
2116 request->set_buffer(buffer);
2117 request->set_callback(callback);
2127 std::shared_ptr<playback_device> raw_streams;
2130 raw_streams = std::make_shared<playback_device>(
ctx, std::make_shared<ros_reader>(source_file,
ctx));
2132 catch (
const std::exception&
e)
2134 LOG_ERROR(
"Failed to create playback device from given file. File = \"" << source_file <<
"\". Exception: " << e.what());
2137 _sensor->enable_loopback(raw_streams);
2149 return _sensor->is_loopback_enabled();
2155 auto tm2_profiles =
_sensor->get_stream_profiles();
2157 for (
int i = 0;
i < tm2_profiles.size();
i++)
MESSAGE_STATUS
Defines all bulk message return statuses.
int tm2_sensor_type(rs2_stream rtype)
std::vector< t265::supported_raw_stream_libtm_message > _supported_raw_streams
static const textual_icon lock
static uint64_t bytesSwap(uint64_t val)
void receive_set_localization_data_complete(const t265::interrupt_message_set_localization_data_stream &message)
GLenum GLuint GLenum GLsizei const GLchar * message
Bulk Get Localization Data Message.
virtual rs2_stream get_stream_type() const =0
float3 mult(const float3x3 &a, const float3 &b)
interrupt_message_gyro_stream_metadata metadata
platform::usb_status stream_write(const t265::bulk_message_request_header *request)
device_info_libtm_message message
GLboolean GLboolean GLboolean b
sensor_temperature temperature[]
Interrupt get pose message.
async_op_state perform_async_transfer(std::function< bool()> transfer_activator, std::function< void()> on_success, const std::string &op_description) const
interrupt_message_accelerometer_stream_metadata metadata
bulk_message_response_header header
bulk_message_response_header header
Interrupt raw accelerometer stream message.
platform::rs_usb_request _stream_request
std::atomic< bool > _is_opened
Base class that establishes the interface for retrieving metadata attributes.
void invoke_callback(frame_holder frame) const
Bulk SLAM override calibration Message.
Bulk Log Control Message.
bool is_enabled() const override
bool is_loopback_enabled() const
rs2_format rs2_format_from_tm2(const uint8_t format)
exposure_option(tm2_sensor &ep)
std::shared_ptr< platform::time_service > get_time_service()
void start(frame_callback_ptr callback) override
virtual std::shared_ptr< notifications_processor > get_notifications_processor() const
void init(std::shared_ptr< metadata_parser_map > metadata_parsers)
motion_intrinsics intrinsics
void raise_error_notification(const std::string &msg)
float_t flNoiseVariances[3]
std::shared_ptr< rs2_frame_callback > frame_callback_ptr
Interrupt Get Localization Data Stream message.
platform::rs_usb_request stream_read_request(std::vector< uint8_t > &buffer, std::shared_ptr< platform::usb_request_callback > callback)
void receive_pose_message(const t265::interrupt_message_get_pose &message)
bulk_message_raw_stream_header rawStreamHeader
sensor_extrinsics extrinsics
const char * get_description() const override
std::atomic< bool > _log_poll_thread_stop
stream_profiles get_stream_profiles(int tag=profile_tag::PROFILE_TAG_ANY) const override
#define GET_SENSOR_INDEX(_sensorID)
void set_manual_exposure(bool manual)
stream_exposure stream[MAX_VIDEO_STREAMS]
uint8_t bLocalizationData[]
bool import_relocalization_map(const std::vector< uint8_t > &lmap_buf) const override
Bulk raw video stream message.
Bulk Set Exposure Control Message Enable/disable the auto-exposure management of the different video ...
bulk_message_video_stream_metadata metadata
GeneratorWrapper< std::vector< T > > chunk(size_t size, GeneratorWrapper< T > &&generator)
void register_stream_to_extrinsic_group(const stream_interface &stream, uint32_t group_index)
bulk_message_velocimeter_stream_metadata metadata
bulk_message_response_header header
bool is_read_only() const override
void register_same_extrinsics(const stream_interface &from, const stream_interface &to)
Bulk write configuration Message.
uint8_t bReferenceSensorID
#define GET_SENSOR_TYPE(_sensorID)
virtual void register_metadata(rs2_frame_metadata_value metadata, std::shared_ptr< md_attribute_parser_base > metadata_parser) const
void enable_loopback(std::shared_ptr< playback_device > input)
void set_timestamp_domain(rs2_timestamp_domain timestamp_domain) override
GLsizei const GLchar *const * string
uint8_t bNumOfVideoStreams
float query() const override
std_msgs::Header * header(M &m)
returns Header<M>::pointer(m);
bulk_message_request_header header
const char * get_description() const override
Interrupt raw gyro stream message.
temperature_option(tm2_sensor &ep, temperature_type type)
camera_intrinsics intrinsics
static const int BUFFER_SIZE
#define ENDPOINT_HOST_INT_IN
const char * get_description() const override
platform::usb_status bulk_request_response(const Request &request, Response &response, size_t max_response_size=0, bool assert_success=true)
Bulk Get Static Node Message.
interrupt_message_raw_stream_header rawStreamHeader
rs2_extrinsics get_extrinsics(const stream_profile_interface &profile, int sensor_id) const
std::thread _time_sync_thread
Bulk Set Localization Data Stream Message.
std::shared_ptr< dispatcher > _data_dispatcher
bool load_wheel_odometery_config(const std::vector< uint8_t > &odometry_config_buf) const override
platform::rs_usb_endpoint endpoint_int_in
void set_exposure_and_gain(float exposure_ms, float gain)
std::condition_variable _async_op
rs2_intrinsics get_intrinsics(const stream_profile &profile) const override
t265::sensor_temperature get_temperature(int sensor_id)
GLboolean GLboolean GLboolean GLboolean a
GLenum GLuint GLenum GLsizei const GLchar * buf
void set_max_publish_list_size(int qsize)
motion_intrinsics intrinsics
def info(name, value, persistent=False)
void set_active_streams(const stream_profiles &requests)
static std::string message_name(const T &header)
bool is_enabled() const override
bool _pose_output_enabled
platform::rs_usb_endpoint endpoint_int_out
void register_extrinsics(const stream_interface &from, const stream_interface &to, std::weak_ptr< lazy< rs2_extrinsics >> extr)
std::string hexify(const T &val)
rs2_motion_device_intrinsic get_motion_intrinsics(const motion_stream_profile_interface &profile) const
void register_info(rs2_camera_info info, const std::string &val)
const char * get_description() const override
float query() const override
void set_timestamp(double new_ts) override
void print_logs(const std::unique_ptr< t265::bulk_message_response_get_and_clear_event_log > &log)
Bulk Get Temperature Message.
stream_profiles init_stream_profiles() override
std::chrono::duration< double, std::milli > global_ts
float_t flBiasVariances[3]
tracking_mode_option(tm2_sensor &sensor, const char *description_)
std::atomic< bool > _time_sync_thread_stop
platform::rs_usb_request_callback _interrupt_callback
void set_extrinsics(const stream_profile_interface &from_profile, const stream_profile_interface &to_profile, const rs2_extrinsics &extr) override
Bulk Set Exposure Message.
void disable_loopback() override
bulk_message_response_header header
bulk_message_raw_stream_header rawStreamHeader
static const char * tm2_device_name()
Bulk reset configuration Message.
uint32_t dwIntegrationTime
void raise_on_before_streaming_changes(bool streaming)
uint32_t dwMapperConfidence
void set_stream(std::shared_ptr< stream_profile_interface > sp) override
std::chrono::duration< double, std::milli > arrival_ts
motion_temperature_option(tm2_sensor &ep)
void set_sensor(const std::shared_ptr< sensor_interface > &s)
uint8_t bGuid[MAX_GUID_LENGTH]
GLint GLsizei GLsizei height
platform::rs_usb_endpoint endpoint_bulk_out
Bulk Set Motion Module Intrinsics Message.
std::atomic< int64_t > device_to_host_ns
void receive_gyro_message(const t265::interrupt_message_gyro_stream &message)
bool is_enabled() const override
GLint GLint GLsizei GLint GLenum format
gain_option(tm2_sensor &ep)
std::map< int, std::pair< uint32_t, std::shared_ptr< const stream_interface > > > _extrinsics
std::shared_ptr< playback_device > _loopback
virtual void set_timestamp(double new_ts)=0
bool supports(const frame &frm) const override
void pass_frames_to_fw(frame_holder fref)
int tm2_sensor_id(rs2_stream type, int stream_index)
Bulk enable low power Message.
unsigned __int64 uint64_t
async_op_state _async_op_status
bool remove_static_node(const std::string &guid) const override
std::chrono::duration< double, std::milli > device_ts
float get_exposure() const
bool export_relocalization_map(std::vector< uint8_t > &lmap_buf) const override
GLdouble GLdouble GLint stride
void receive_accel_message(const t265::interrupt_message_accelerometer_stream &message)
std::shared_ptr< tm2_sensor > _sensor
platform::rs_usb_endpoint endpoint_msg_in
rs2_format
A stream's format identifies how binary data is encoded within a frame.
#define ENDPOINT_HOST_MSGS_OUT
Supported Raw Stream libtm Message.
bool log_poll_once(std::unique_ptr< t265::bulk_message_response_get_and_clear_event_log > &log_buffer)
float query() const override
#define ENDPOINT_HOST_MSGS_IN
std::shared_ptr< tm2_sensor > get_tm2_sensor()
Bulk Raw Streams Control Message.
const char * get_description() const override
bool is_enabled() const override
void update_info(rs2_camera_info info, const std::string &val)
Bulk 6DoF Control Message.
std::vector< std::shared_ptr< stream_profile_interface >> stream_profiles
void enable_loopback(const std::string &source_file) override
rs2_stream
Streams are different types of data provided by RealSense devices.
Bulk Set Camera Intrinsics Message.
frame_interface * alloc_frame(rs2_extension type, size_t size, frame_additional_data additional_data, bool requires_memory) const
bulk_message_request_header header
static environment & get_instance()
int add_sensor(const std::shared_ptr< sensor_interface > &sensor_base)
static const int MAX_TRANSFER_SIZE
extrinsics_graph & get_extrinsics_graph()
const char * get_description() const override
std::chrono::duration< uint64_t, std::nano > nanoseconds
void set_sensor(std::shared_ptr< sensor_interface > s) override
static const int USB_TIMEOUT
option_range get_range() const override
::geometry_msgs::Pose_< std::allocator< void > > Pose
bulk_message_response_header header
asic_temperature_option(tm2_sensor &ep)
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
platform::rs_usb_messenger usb_messenger
bulk_message_response_header header
LOG_INFO("Log message using LOG_INFO()")
void receive_video_message(const t265::bulk_message_video_stream *message)
Interrupt SLAM error message.
void set_exposure(float value)
GLuint GLfloat GLfloat GLfloat x1
uint32_t dwFWVersionBuild
std::shared_ptr< context > get_context() const override
void set_motion_device_intrinsics(const stream_profile_interface &stream_profile, const rs2_motion_device_intrinsic &intr) override
camera_intrinsics intrinsics
Bulk Get Device Info Message.
bool set_static_node(const std::string &guid, const float3 &pos, const float4 &orient_quat) const override
static std::string status_name(const T &header)
sensor_extrinsics extrinsics
float query() const override
Bulk Get Supported Raw Streams Message.
GLenum GLenum GLenum input
void open(const stream_profiles &requests) override
void dispatch_threaded(frame_holder frame)
stream_profile to_profile(const stream_profile_interface *sp)
uint8_t bGuid[MAX_GUID_LENGTH]
long long rs2_metadata_type
void log(std::string message)
t265::SIXDOF_MODE _tm_mode
std::shared_ptr< metadata_parser_map > _metadata_parsers
void set_gain(float value)
std::string async_op_to_string(tm2_sensor::async_op_state val)
void write_calibration() override
uint8_t bGuid[MAX_GUID_LENGTH]
bool is_enabled() const override
interrupt_message_header header
virtual int get_stream_index() const =0
size_t copy_array(T(&dst)[size_tgt], const S(&src)[size_src])
typename::boost::move_detail::remove_reference< T >::type && move(T &&t) BOOST_NOEXCEPT
void set_callback(frame_callback_ptr callback)
interrupt_message_raw_stream_header rawStreamHeader
#define ENDPOINT_HOST_OUT
md_tm2_parser(rs2_frame_metadata_value type)
platform::usb_device_info usb_info
platform::rs_usb_request_callback _stream_callback
platform::rs_usb_request interrupt_read_request(std::vector< uint8_t > &buffer, std::shared_ptr< platform::usb_request_callback > callback)
Interrupt Set Localization Data Stream message.
Motion device intrinsics: scale, bias, and variances.
void handle_imu_frame(unsigned long long tm_frame_ts, unsigned long long frame_number, rs2_stream stream_type, int index, float3 imu_data, float temperature)
uint32_t dwTrackerConfidence
coordinated_ts get_coordinated_timestamp(uint64_t device_nanoseconds)
void receive_localization_data_chunk(const t265::interrupt_message_get_localization_data_stream *chunk)
#define offsetof(STRUCTURE, FIELD)
GLenum GLuint GLenum GLsizei length
virtual void set_timestamp_domain(rs2_timestamp_domain timestamp_domain)=0
rs2_frame_metadata_value _type
void set_extrinsics_to_ref(rs2_stream stream_type, int stream_index, const rs2_extrinsics &extr)
platform::rs_usb_endpoint endpoint_bulk_in
#define MAX_SLAM_CALIBRATION_SIZE
platform::rs_usb_endpoint endpoint_msg_out
std::vector< uint8_t > _async_op_res_buffer
static const uint16_t ID_OEM_CAL
void hardware_reset() override
#define ENDPOINT_HOST_INT_OUT
exposure_mode_option(tm2_sensor &ep)
const std::map< PixelFormat, rs2_format > tm2_formats_map
Interrupt SLAM Relocalization Event message.
std::atomic< bool > _is_streaming
tm2_device(std::shared_ptr< context > ctx, const platform::backend_device_group &group, bool register_device_notifications)
std::vector< t265::supported_raw_stream_libtm_message > _active_raw_streams
void set_intrinsics(const stream_profile_interface &stream_profile, const rs2_intrinsics &intr) override
virtual int get_unique_id() const =0
int get_image_bpp(rs2_format format)
Bulk Get and Clear Event Log Message.
bool send_wheel_odometry(uint8_t wo_sensor_id, uint32_t frame_num, const float3 &translational_velocity) const override
bool is_enabled() const override
uint32_t dwDistortionModel
float query() const override
bool cancel_request(platform::rs_usb_request request)
Bulk raw velocimeter stream message.
rs2_frame_metadata_value
Per-Frame-Metadata is the set of read-only properties that might be exposed for each individual frame...
bool get_static_node(const std::string &guid, float3 &pos, float4 &orient_quat) const override
#define SET_SENSOR_ID(_type, _index)
void reset_to_factory_calibration() override
void submit_request(platform::rs_usb_request request)
uint8_t bVideoStreamsMask
void raise_relocalization_event(const std::string &msg, double timestamp)
platform::rs_usb_request _interrupt_request
std::thread _log_poll_thread
virtual void set_stream(std::shared_ptr< stream_profile_interface > sp)=0
std::string to_string(T value)