-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
dds stream type derivations; rs-enumerate-devices works #11075
Conversation
src/context.cpp
Outdated
int8_t index; // Used to distinguish similar streams like IR L / R, 0 otherwise | ||
|
||
sid_index( int sid_, int index_ ) | ||
: sid( static_cast< int16_t >( sid_ ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why cast and not save as int? If it is received from LibRS as int then there is no point casting it. If need to cast when sending over DDS cast there, If the message interface will change, no need to update here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a copy from dds_stream_uid
that was removed. You're right, but I don't think it's important right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer that we will fix this now, we have to many things we commented on as "for later" and we'll forget to update them all
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
src/context.cpp
Outdated
|
||
std::string to_string() const { return '(' + std::to_string( sid ) + '.' + std::to_string( index ) + ')'; } | ||
|
||
inline bool operator<( sid_index const & r ) const { return this->sid < r.sid || this->index < r.index; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a well defined "smaller than" operation. If a = { 5, 0 } and b = { 3, 1 } then a < b is true and also b < a is true;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't matter, as long as it's consistent. This is simply a requirement for ordering items in a map.
That said, I think it's logical to break by sid
and then index
-- which is what I did, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is logical to break sid
and then index
, but I think it means:
this->sid < r.sid || ( this->sid == r.sid && this->index < r.index )
No case when this->sid > r.sid
will return true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right :)
@@ -27,35 +27,68 @@ using namespace TCLAP; | |||
using namespace realdds; | |||
|
|||
|
|||
#define NAME2SERVER( X ) \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is only used in get_supported_streams
(including variable names) it is better to #define and #undef it in the function scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now you're reaching... ;)
complain if device.open() or .close() with no profiles/streams
reverse frequency & format in profile ctors to fit order in json
add basic d435i test
add
RS2_PRODUCT_LINE_SW_ONLY
to find only software devices in contextrs-enumerate-devices
now has--debug
,--sw-only
,--dds-domain
flagsfix bug with context creation on pyrealsense2 load (a default context was always created, making creating another context for DDS impossible)
changed rs2 (sid.index) calc in the device-/sensor-proxy