Skip to content

Commit

Permalink
DDS Y16 streaming is mono16 for ROS2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir committed Jan 19, 2025
1 parent d40c2e2 commit 855cca4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion third-party/realdds/py/pyrealdds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ PYBIND11_MODULE(NAME, m) {
.def( "__repr__", []( dds_video_encoding const & self ) { return self.to_string(); } );
video_encoding.attr( "z16" ) = dds_video_encoding( "16UC1" );
video_encoding.attr( "y8" ) = dds_video_encoding( "mono8" );
video_encoding.attr( "y16" ) = dds_video_encoding( "Y16" ); // todo should be mono16
video_encoding.attr( "y16" ) = dds_video_encoding( "mono16" );
video_encoding.attr( "byr2" ) = dds_video_encoding( "BYR2" );
video_encoding.attr( "yuyv" ) = dds_video_encoding( "yuv422_yuy2" );
video_encoding.attr( "uyvy" ) = dds_video_encoding( "uyvy" );
Expand Down
4 changes: 2 additions & 2 deletions third-party/realdds/src/dds-stream-profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int dds_video_encoding::to_rs2() const
{ "mono8", RS2_FORMAT_Y8 }, // Used by IR streams; ROS2-compatible
{ "Y8I", RS2_FORMAT_Y8I },
{ "W10", RS2_FORMAT_W10 },
{ "Y16", RS2_FORMAT_Y16 },
{ "mono16", RS2_FORMAT_Y16 }, // Used by IR streams; ROS2-compatible
{ "Y12I", RS2_FORMAT_Y12I },
// { "Y16I", RS2_FORMAT_Y16I },
{ "16UC1", RS2_FORMAT_Z16 }, // Used by depth streams; ROS2-compatible
Expand Down Expand Up @@ -113,7 +113,7 @@ dds_video_encoding dds_video_encoding::from_rs2( int rs2_format )
case RS2_FORMAT_Y8: encoding = "mono8"; break;
case RS2_FORMAT_Y8I: encoding = "Y8I"; break;
case RS2_FORMAT_W10: encoding = "W10"; break;
case RS2_FORMAT_Y16: encoding = "Y16"; break;
case RS2_FORMAT_Y16: encoding = "mono16"; break;
case RS2_FORMAT_Y12I: encoding = "Y12I"; break;
// case RS2_FORMAT_Y16I: encoding = "Y16I"; break;
case RS2_FORMAT_Z16: encoding = "16UC1"; break;
Expand Down
8 changes: 4 additions & 4 deletions unit-tests/dds/test-stream-sensor-bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ def find_server_profile( stream_name, profile_string ):
bridge.open( find_server_profile( 'Infrared_1', '1280x800 mono8 @ 30 Hz' ))
bridge.close( servers['Infrared_1'] )
bridge.close( servers['Infrared_1'] )
bridge.open( find_server_profile( 'Infrared_1', '1280x800 Y16 @ 25 Hz' ))
bridge.open( find_server_profile( 'Infrared_1', '1280x800 mono16 @ 25 Hz' ))
bridge.reset()
bridge.open( find_server_profile( 'Infrared_1', '1280x800 Y16 @ 15 Hz' ))
bridge.open( find_server_profile( 'Infrared_1', '1280x800 mono16 @ 15 Hz' ))
test.check_throws( lambda:
bridge.open( find_server_profile( 'Infrared_1', '1280x800 Y16 @ 25 Hz' )),
RuntimeError, "profile <'Infrared_1' 1280x800 Y16 @ 25 Hz> is incompatible with already-open <'Infrared_1' 1280x800 Y16 @ 15 Hz>" )
bridge.open( find_server_profile( 'Infrared_1', '1280x800 mono16 @ 25 Hz' )),
RuntimeError, "profile <'Infrared_1' 1280x800 mono16 @ 25 Hz> is incompatible with already-open <'Infrared_1' 1280x800 mono16 @ 15 Hz>" )
reset()
#
#############################################################################################
Expand Down

0 comments on commit 855cca4

Please sign in to comment.