Skip to content

Commit 3f28f26

Browse files
committed
open-streams reset flag defaults false. Fix documentation and rs-dds-adapter
1 parent db179aa commit 3f28f26

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

third-party/realdds/doc/streaming.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ The `stream-profiles` is a mapping from `stream-name` to a `profile`. The `profi
153153

154154
If the `stream-name` or `profile` are not found, this should result in an error.
155155

156-
If a field called `reset` is set to `true` (the default -- the above JSON therefore has it at `true`), any previous `open-streams` are forgotten and the server resets all sensors to default profiles before processing the `stream-profiles` (which can be empty).
156+
If a field called `reset` is set to `true` (defaults to `false` -- the above JSON therefore has it at `false`), any previous `open-streams` are forgotten and the server resets all sensors to default profiles before processing the `stream-profiles` (which can be empty).
157157

158158
Multiple streams can be configured by a single `open-streams`. If these streams share a `sensor-name` (see [initialization](initialization.md#stream-header)), they must be compatible or an error will result.
159159

tools/dds/dds-adapter/lrs-device-controller.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,16 +1046,17 @@ void lrs_device_controller::fill_ros2_node_entities( realdds::topics::ros2::node
10461046

10471047
bool lrs_device_controller::on_open_streams( json const & control, json & reply )
10481048
{
1049-
// Note that this function is called "start-streaming" but it's really a response to "open-streams" so does not
1050-
// actually start streaming. It simply sets and locks in which streams should be open when streaming starts.
1049+
// Note this function is a response to "open-streams" so does not actually start streaming.
1050+
// It simply sets and locks in which streams should be open when streaming starts.
10511051
// This effectively lets one control _specifically_ which streams should be streamable, and nothing else: if left
10521052
// out, a sensor is reset back to its default state using implicit stream selection.
10531053
// (For example, the 'Stereo Module' sensor controls Depth, IR1, IR2: but turning on all 3 has performance
10541054
// implications and may not be desirable. So you can open only Depth and IR1/2 will stay inactive...)
1055-
if( control.nested( topics::control::open_streams::key::reset ).default_value( true ) )
1055+
if( control.nested( topics::control::open_streams::key::reset ).default_value( false ) )
10561056
_bridge.reset();
10571057

1058-
auto const & msg_profiles = control[topics::control::open_streams::key::stream_profiles];
1058+
json msg_profiles;
1059+
control.nested( topics::control::open_streams::key::stream_profiles ).get_ex( msg_profiles ); // Might be an empty list
10591060
for( auto const & name2profile : msg_profiles.items() )
10601061
{
10611062
std::string const & stream_name = name2profile.key();

0 commit comments

Comments
 (0)