Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T265 query devices fix #3515

Merged
merged 10 commits into from
Mar 21, 2019
Merged

Conversation

ev-mp
Copy link
Collaborator

@ev-mp ev-mp commented Mar 17, 2019

T265: make context::query_devices to discover and enumerate device in a robust and deterministic manner.

Changes:

  1. Implement device discovery and proper enumeration flow:
  • Invoke device discovery events
  • Wait for a predefined amount of time.
  • For each discovered DFU-mode device:
    • extend the timeout ( bounded by global max timeout)
    • Track DFU vs FW-Loaded devices.
  • Stop when all DFU-devices have been loaded, or alternatively a timeout occurred.
  1. Device_hub to use internal device event callback instead of overriding user-defined callback
  2. Examples utils - add support pose and motion data render (pose as text). Adjust demos affected by the change: rs-record-playback, rs-align, rs-measure.
    4 Reorder query_devices to prioritize D400 over T265
  3. rs-multicam:
  • Rework to handle hw events in the main thread instead of callback.
  • Adapt for high-fps rate devices
  1. rs-enumerate-devices - to provide a robust enumeration of all the connected T265 devices on startup (tested with up to four units)

Optimizations& Bug fixes:

  • Reducing TM2 initialization time by 500 msec
  • Device_hub to track TM2 connect events
  • T265 logger initialization to prevent race condition with the FSM thread startup logs
  • T265 6DOF Pose frame rate - 200fps and not as previously stated
  • Uninitialized T265 intrinsic parameter
  • TM2 Header compilation dependency
  • GCC/Cland-proposed fixes

Addresses #3488, #3465, #3361, also related to #3437, #3434
Tracked on: TM2-4235

@ev-mp ev-mp force-pushed the tm2_query_devices branch 3 times, most recently from 1b1abbd to 53086d3 Compare March 18, 2019 10:36
Refactor TM2 Header compilation dependency
Device_hub to track TM2 connect events
Modify example rendered to support pose and motion data. Adjust demos affected by the change.
Fix constness management

Change-Id: Ieb8652bc95bb167e4522888c5fef5db346f75d4b
tm2_query_device shall be blocking awaiting T265 discovery and firmware load to take place
Flow:
- Invoke device discovery events
- Wait for a predefined amount of time.
- For each discovered DFU-mode device:
	- extend the timeout  ( bounded by global max timeout)
	- Track cound of DFU vs FW-Loaded devices.
- Stop when all DFU-devices have been loaded, or alternatively a timeout occurred.

Bug fixes:
 - Reducing TM2 initialization time by 500 msec
 - The logger must be initialized before the FSM thread, otherwise it looses FSM startup messages due to race
 - Fix Pose frame rate - 200fps and not as previously stated
 - Fix uninitialized intrinsic parameter

 - Optimization refactoring

Change-Id: Ide54a54c8dcf00369b1dd097dbf3ff8a6d53e629
@ev-mp ev-mp force-pushed the tm2_query_devices branch 2 times, most recently from 99f2c77 to 8c79a52 Compare March 18, 2019 20:30
ev-mp and others added 2 commits March 18, 2019 22:41
Device_hub to use internal device event callback instead of overriding user-defined callback
Multicam - handle hw event in the main thread instead of callback

Change-Id: I46b5ae75483f1b078d0f623262a0ef285f849069
Explicit specialization in non-namespace scope
Enforce explicit renderer assignment
@ev-mp ev-mp force-pushed the tm2_query_devices branch 3 times, most recently from d03df6c to 79a503e Compare March 18, 2019 22:52
TM2 Logger to report errors
GCC/Cland fixes/enhancement: fix atomic load/store, remove unused variables, -wpedantic
rs-multicam: Remove debug messages & code cleanup
Change-Id: I7b0281b4085017455f14014d8f65bbd16032b464
@dorodnic dorodnic added this to the v2.19.2 milestone Mar 19, 2019
@dorodnic dorodnic added the T260 series Intel® T265 library label Mar 19, 2019
- Simplify rs-multicam by removing dynamic device enumeration
- Renderer to use implicit conversion
- Fix T265 log verbosity level
- Remove templatized rendering
- Update the rs-multicam example documentation

Change-Id: I9fc5632f04482715a085f0721c76078a4d54442f
// Provide textual representation only
void put_text(const std::string& msg, float norm_x_pos, float norm_y_pos, const rect& r)
{
if (!_gl_handle)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need _gl_handle?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

}

private:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -106,6 +103,9 @@ namespace librealsense

typedef std::vector<std::shared_ptr<device_info>> devices_info;

//FW Decl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

{
if (uvc.vid == vid || vid == 0)
{
result.push_back(dev);
break;
}
}

if (data.tm2_devices.size() && (0== vid))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why vid==0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vid-based filtering is currently not supported for T265. Backend changes in tm2_info are required.
I made a semantic change to improve maintainability, also marked a TODO

@@ -44,6 +44,9 @@ namespace perc
static std::mutex instanceExistMutex;
static bool instanceExist;

// Await USB device discovery completion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is somewhat confusing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack-d

- Make hub_device filtering more explicit, add TODO for tm2_info missing part
- Fix/Amend comments

Change-Id: I94d87798d2205cf6692416a03a5ab3453e721660
@ev-mp ev-mp merged commit 0cd79ad into IntelRealSense:development Mar 21, 2019
schmidtp1 added a commit to schmidtp1/librealsense that referenced this pull request Apr 2, 2019
@ev-mp ev-mp deleted the tm2_query_devices branch April 18, 2019 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T260 series Intel® T265 library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants