Skip to content

Commit

Permalink
PR #12822 from Eran: Fix legacy intrinsics serialization and uppercas…
Browse files Browse the repository at this point in the history
…e 'OK' status
  • Loading branch information
maloel authored Apr 3, 2024
2 parents 24dd7ba + e4bbf09 commit 997d079
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
22 changes: 21 additions & 1 deletion third-party/realdds/src/dds-trinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,27 @@ json video_intrinsics::to_json() const
ret.principal_point.y = j[index++].get< float >();
ret.focal_length.x = j[index++].get< float >();
ret.focal_length.y = j[index++].get< float >();
ret.distortion.model = (distortion_model)j[index++].get< int >();
switch( j[index++].get< int >() )
{
case 0: // RS2_DISTORTION_NONE
ret.distortion.model = distortion_model::none;
break;

case 1: // RS2_DISTORTION_MODIFIED_BROWN_CONRADY
ret.distortion.model = distortion_model::modified_brown;
break;

case 2: // RS2_DISTORTION_INVERSE_BROWN_CONRADY
ret.distortion.model = distortion_model::inverse_brown;
break;

case 4: // RS2_DISTORTION_BROWN_CONRADY
ret.distortion.model = distortion_model::brown;
break;

default:
DDS_THROW( runtime_error, "invalid legacy distortion model: " << j[index-1] );
}
ret.distortion.coeffs[0] = j[index++].get< float >();
ret.distortion.coeffs[1] = j[index++].get< float >();
ret.distortion.coeffs[2] = j[index++].get< float >();
Expand Down
2 changes: 1 addition & 1 deletion third-party/realdds/src/topics/dds-topic-names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ namespace reply {
std::string const explanation( "explanation", 11 );
}
namespace status {
std::string const ok( "ok", 2 );
std::string const ok( "OK", 2 );
}
namespace set_option {
//using control::set_option::id;
Expand Down

0 comments on commit 997d079

Please sign in to comment.