Skip to content

Commit

Permalink
Merge branch 'gz-sensors8' into merge_8_main_20240822
Browse files Browse the repository at this point in the history
  • Loading branch information
iche033 committed Aug 23, 2024
2 parents 1a5a558 + f2fe577 commit 3505389
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/RgbdCameraSensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,6 @@ bool RgbdCameraSensor::Load(const sdf::Sensor &_sdf)
if (!this->AdvertiseInfo(this->Topic() + "/camera_info"))
return false;

// Initialize the point message.
// \todo(anyone) The true value in the following function call forces
// the xyz and rgb fields to be aligned to memory boundaries. This is need
// by ROS1: https://github.com/ros/common_msgs/pull/77. Ideally, memory
// alignment should be configured.
msgs::InitPointCloudPacked(this->dataPtr->pointMsg, this->FrameId(), true,
{{"xyz", msgs::PointCloudPacked::Field::FLOAT32},
{"rgb", msgs::PointCloudPacked::Field::FLOAT32}});

if (this->Scene())
{
this->CreateCameras();
Expand Down Expand Up @@ -396,6 +387,16 @@ bool RgbdCameraSensor::CreateCameras()
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
std::placeholders::_4, std::placeholders::_5));

// Initialize the point message.
// \todo(anyone) The true value in the following function call forces
// the xyz and rgb fields to be aligned to memory boundaries. This is need
// by ROS1: https://github.com/ros/common_msgs/pull/77. Ideally, memory
// alignment should be configured.
msgs::InitPointCloudPacked(this->dataPtr->pointMsg, this->OpticalFrameId(),
true,
{{"xyz", msgs::PointCloudPacked::Field::FLOAT32},
{"rgb", msgs::PointCloudPacked::Field::FLOAT32}});

// Set the values of the point message based on the camera information.
this->dataPtr->pointMsg.set_width(this->ImageWidth());
this->dataPtr->pointMsg.set_height(this->ImageHeight());
Expand Down

0 comments on commit 3505389

Please sign in to comment.