Skip to content

Commit

Permalink
Renamed ignition_frame_id to gz_frame_id and fix warning (#296)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Hernández Cordero <[email protected]>
  • Loading branch information
ahcorde authored Dec 6, 2022
1 parent 8e8dfa8 commit ea7d33a
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
16 changes: 13 additions & 3 deletions src/Sensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,23 @@ bool SensorPrivate::PopulateFromSDF(const sdf::Sensor &_sdf)
sdf::ElementPtr element = _sdf.Element();
if (element)
{
if (element->HasElement("ignition_frame_id"))
if (element->HasElement("gz_frame_id"))
{
this->frame_id = element->Get<std::string>("ignition_frame_id");
this->frame_id = element->Get<std::string>("gz_frame_id");
}
else
{
this->frame_id = this->name;
// TODO(ahcorde): Remove this deprecation in gz-sensors8
if (element->HasElement("ignition_frame_id"))
{
gzwarn << "The `ignition_frame_id` tag is deprecated. "
<< "Please use `gz_frame_id` instead." << std::endl;
this->frame_id = element->Get<std::string>("ignition_frame_id");
}
else
{
this->frame_id = this->name;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/integration/triggered_camera.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void TriggeredCameraTest::ImagesWithBuiltinSDF(const std::string &_renderEngine)
"/test/integration/TriggeredCameraPlugin_imagesWithBuiltinSDF";
WaitForMessageTestHelper<gz::msgs::Image> helper(imageTopic);
mgr.RunOnce(std::chrono::steady_clock::duration::zero(), true);
EXPECT_TRUE(helper.WaitForMessage()) << helper;
EXPECT_TRUE(helper.WaitForMessage(10s)) << helper;
}

// test removing sensor
Expand Down
4 changes: 2 additions & 2 deletions test/sdf/camera_intrinsics.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link name="link1">
<sensor name="camera_without_intrinsics_tag" type="camera">
<update_rate>10</update_rate>
<ignition_frame_id>base_camera</ignition_frame_id>
<gz_frame_id>base_camera</gz_frame_id>
<topic>/camera1/image</topic>
<camera>
<horizontal_fov>1.05</horizontal_fov>
Expand All @@ -17,7 +17,7 @@
</sensor>
<sensor name="camera_with_intrinsics_tag" type="camera">
<update_rate>10</update_rate>
<ignition_frame_id>base_camera</ignition_frame_id>
<gz_frame_id>base_camera</gz_frame_id>
<topic>/camera2/image</topic>
<camera>
<horizontal_fov>1.05</horizontal_fov>
Expand Down
2 changes: 1 addition & 1 deletion test/sdf/camera_sensor_builtin.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link name="link1">
<sensor name="camera1" type="camera">
<update_rate>10</update_rate>
<ignition_frame_id>base_camera</ignition_frame_id>
<gz_frame_id>base_camera</gz_frame_id>
<topic>/test/integration/CameraPlugin_imagesWithBuiltinSDF</topic>
<camera>
<horizontal_fov>1.05</horizontal_fov>
Expand Down
2 changes: 1 addition & 1 deletion test/sdf/camera_sensor_l16_builtin.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link name="link1">
<sensor name="camera1" type="camera">
<update_rate>10</update_rate>
<ignition_frame_id>base_camera</ignition_frame_id>
<gz_frame_id>base_camera</gz_frame_id>
<topic>/images_l16</topic>
<camera>
<horizontal_fov>1.05</horizontal_fov>
Expand Down
4 changes: 2 additions & 2 deletions test/sdf/camera_sensor_l8_l16_builtin.sdf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<link name="link1">
<sensor name="camera_8_bit" type="camera">
<update_rate>10</update_rate>
<ignition_frame_id>base_camera</ignition_frame_id>
<gz_frame_id>base_camera</gz_frame_id>
<topic>/images_l8</topic>
<camera>
<horizontal_fov>1.05</horizontal_fov>
Expand All @@ -26,7 +26,7 @@
</sensor>
<sensor name="camera_16_bit" type="camera">
<update_rate>10</update_rate>
<ignition_frame_id>base_camera</ignition_frame_id>
<gz_frame_id>base_camera</gz_frame_id>
<topic>/images_l16</topic>
<camera>
<horizontal_fov>1.05</horizontal_fov>
Expand Down

0 comments on commit ea7d33a

Please sign in to comment.