Skip to content

Commit

Permalink
Apply suggestions from code review, adjusted code to recent API changes.
Browse files Browse the repository at this point in the history
Co-authored-by: Steve Pham <[email protected]>
Signed-off-by: Michał Pełka <[email protected]>
  • Loading branch information
michalpelka and spham-amzn committed Mar 13, 2023
1 parent c787906 commit 8d2a8c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Gems/ROS2/Code/Source/Camera/CameraSensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,14 +267,14 @@ namespace ROS2
void CameraRGBDSensor::ReadBackDepth(
AZStd::function<void(const AZ::RPI::AttachmentReadback::ReadbackResult& result)> callback)
{
AZ::Render::FrameCaptureId captureId = AZ::Render::InvalidFrameCaptureId;
AZ::Render::FrameCaptureOutcome captureOutcome;
AZStd::vector<AZStd::string> passHierarchy{m_pipelineName,"DepthPrePass"};
AZ::Render::FrameCaptureRequestBus::BroadcastResult(
captureId,
captureOutcome,
&AZ::Render::FrameCaptureRequestBus::Events::CapturePassAttachmentWithCallback,
callback,
passHierarchy,
AZStd::string("DepthLinear"),
callback,
AZ::RPI::PassAttachmentReadbackOption::Output);
}

Expand Down
9 changes: 4 additions & 5 deletions Gems/ROS2/Code/Source/Camera/CameraSensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,14 @@ namespace ROS2

//! Request a frame from the rendering pipeline
//! @param cameraPose - current camera pose from which the rendering should take place
//! @param callback - callback function object that will be called when capture is ready
//! it's argument is readback structure containing, among other thins, captured image
//! @param callback - callback function object that will be called when capture is ready.
//! It's argument is readback structure containing, among other things, a captured image
void RequestFrame(
const AZ::Transform& cameraPose, AZStd::function<void(const AZ::RPI::AttachmentReadback::ReadbackResult& result)> callback);

//! Request an additional frame from the rendering pipeline
//! @param cameraPose - current camera pose from which the rendering should take place
//! @param callback - callback function object that will be called when capture is ready
//! it's argument is readback structure containing, among other thins, captured image
//! @param callback - callback function object that will be called when capture is ready.
//! It's argument is readback structure containing, among other things, a captured image
//! @param passName - pass name in pipeline, eg `DepthToLinearDepthPass`
//! @param slotName - slot name in selected pass, eg `Output`
void RequestAdditionalFrame(
Expand Down
4 changes: 2 additions & 2 deletions Gems/ROS2/Code/Source/Camera/ROS2CameraSensorComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ namespace ROS2
std_msgs::msg::Header ros_header;
if (!m_imagePublishers.empty() && m_cameraSensor)
{
const auto& camera_descritpion = m_cameraSensor->GetCameraSensorDescription();
const auto& cameraIntrinsics = camera_descritpion.m_cameraIntrinsics;
const auto& cameraDescription = m_cameraSensor->GetCameraSensorDescription();
const auto& cameraIntrinsics = cameraDescription.m_cameraIntrinsics;
sensor_msgs::msg::CameraInfo cameraInfo;
ros_header.stamp = timestamp;
ros_header.frame_id = m_frameName.c_str();
Expand Down

0 comments on commit 8d2a8c6

Please sign in to comment.