Skip to content

Commit

Permalink
IMU custom_rpy parent_frame should be set to 'world' (#212)
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya <aditya050995@gmail.com>
  • Loading branch information
adityapande-1995 authored Apr 4, 2022
1 parent 62da728 commit f7f9aca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ImuSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,14 @@ void ImuSensor::SetWorldFrameOrientation(
// Set orientation reference frame if custom_rpy was supplied
if (this->dataPtr->sensorOrientationRelativeTo == WorldFrameEnumType::CUSTOM)
{
if (this->dataPtr->customRpyParentFrame == "")
if (this->dataPtr->customRpyParentFrame == "world")
{
this->SetOrientationReference(this->dataPtr->worldRelativeOrientation *
this->dataPtr->customRpyQuaternion);
}
else
{
ignwarn << "custom_rpy parent frame must be set to empty "
ignwarn << "custom_rpy parent frame must be set to 'world' "
"string. Setting it to any other frame is not "
"supported yet." << std::endl;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ImuSensor_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ TEST(ImuSensor_TEST, OrientationReference)
<< " <imu>"
<< " <orientation_reference_frame>"
<< " <localization>CUSTOM</localization>"
<< " <custom_rpy>1.570795 0 0</custom_rpy>"
<< " <custom_rpy parent_frame='world'>1.570795 0 0</custom_rpy>"
<< " </orientation_reference_frame>"
<< " </imu>"
<< " <always_on>1</always_on>"
Expand Down Expand Up @@ -507,7 +507,7 @@ TEST(ImuSensor_TEST, CustomRpyParentFrame)
sensor->Update(std::chrono::steady_clock::duration(
std::chrono::nanoseconds(10000000)));

// Since parent_frame is not set to empty in the sdf,
// Since parent_frame is not set to 'world' in the sdf,
// custom_rpy will be rejected and reference orientation will
// not be set.
math::Quaterniond orientValue(math::Vector3d(-1.570795, 0, 0));
Expand Down

0 comments on commit f7f9aca

Please sign in to comment.