Skip to content

Commit

Permalink
Power uvc_device for 1 second after creation
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir committed Dec 24, 2024
1 parent e18af41 commit 5d995ee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ds/d400/d400-color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ namespace librealsense
std::unique_ptr<frame_timestamp_reader>(new global_timestamp_reader(std::move(ds_timestamp_reader_metadata), _tf_keeper, enable_global_time_option)),
this);

// Many commands need power during initialization phase, no point turning it on and off again for each.
raw_color_ep->power_for_duration( std::chrono::milliseconds( 1000 ) );

auto color_ep = std::make_shared<d400_color_sensor>(this,
raw_color_ep,
d400_color_fourcc_to_rs2_format,
Expand Down
3 changes: 3 additions & 0 deletions src/ds/d400/d400-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ namespace librealsense

raw_depth_ep->register_xu(depth_xu); // make sure the XU is initialized every time we power the camera

// Many commands need power during initialization phase, no point turning it on and off again for each.
raw_depth_ep->power_for_duration( std::chrono::milliseconds( 1000 ) );

auto depth_ep = std::make_shared<d400_depth_sensor>(this, raw_depth_ep);

depth_ep->register_info(RS2_CAMERA_INFO_PHYSICAL_PORT, filter_by_mi(all_device_infos, 0).front().device_path);
Expand Down
3 changes: 3 additions & 0 deletions src/ds/d500/d500-color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ namespace librealsense
enable_global_time_option ) ),
this );

// Many commands need power during initialization phase, no point turning it on and off again for each.
raw_color_ep->power_for_duration( std::chrono::milliseconds( 1000 ) );

auto color_ep = std::make_shared<d500_color_sensor>(this,
raw_color_ep,
d500_color_fourcc_to_rs2_format,
Expand Down
3 changes: 3 additions & 0 deletions src/ds/d500/d500-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,9 @@ namespace librealsense

raw_depth_ep->register_xu(depth_xu); // make sure the XU is initialized every time we power the camera

// Many commands need power during initialization phase, no point turning it on and off again for each.
raw_depth_ep->power_for_duration( std::chrono::milliseconds( 1000 ) );

auto depth_ep = std::make_shared<d500_depth_sensor>(this, raw_depth_ep);

depth_ep->register_info(RS2_CAMERA_INFO_PHYSICAL_PORT, filter_by_mi(all_device_infos, 0).front().device_path);
Expand Down

0 comments on commit 5d995ee

Please sign in to comment.