Skip to content

Commit 22af01a

Browse files
authored
Merge pull request #462 from gazebosim/merge_8_main_20240822
Merge 8 -> main
2 parents 40d966b + 931c4dc commit 22af01a

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/RgbdCameraSensor.cc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,6 @@ bool RgbdCameraSensor::Load(const sdf::Sensor &_sdf)
253253
if (!this->AdvertiseInfo(this->Topic() + "/camera_info"))
254254
return false;
255255

256-
// Initialize the point message.
257-
// \todo(anyone) The true value in the following function call forces
258-
// the xyz and rgb fields to be aligned to memory boundaries. This is need
259-
// by ROS1: https://github.com/ros/common_msgs/pull/77. Ideally, memory
260-
// alignment should be configured.
261-
msgs::InitPointCloudPacked(this->dataPtr->pointMsg, this->FrameId(), true,
262-
{{"xyz", msgs::PointCloudPacked::Field::FLOAT32},
263-
{"rgb", msgs::PointCloudPacked::Field::FLOAT32}});
264-
265256
if (this->Scene())
266257
{
267258
this->CreateCameras();
@@ -396,6 +387,16 @@ bool RgbdCameraSensor::CreateCameras()
396387
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
397388
std::placeholders::_4, std::placeholders::_5));
398389

390+
// Initialize the point message.
391+
// \todo(anyone) The true value in the following function call forces
392+
// the xyz and rgb fields to be aligned to memory boundaries. This is need
393+
// by ROS1: https://github.com/ros/common_msgs/pull/77. Ideally, memory
394+
// alignment should be configured.
395+
msgs::InitPointCloudPacked(this->dataPtr->pointMsg, this->OpticalFrameId(),
396+
true,
397+
{{"xyz", msgs::PointCloudPacked::Field::FLOAT32},
398+
{"rgb", msgs::PointCloudPacked::Field::FLOAT32}});
399+
399400
// Set the values of the point message based on the camera information.
400401
this->dataPtr->pointMsg.set_width(this->ImageWidth());
401402
this->dataPtr->pointMsg.set_height(this->ImageHeight());

0 commit comments

Comments
 (0)