Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor camera demo #634

Merged
merged 13 commits into from
Dec 18, 2024
Merged

Refactor camera demo #634

merged 13 commits into from
Dec 18, 2024

Conversation

caguero
Copy link
Contributor

@caguero caguero commented Nov 5, 2024

Refactors the camera demo leveraging the latest improvements in ros_gz.

  • I replaced the previous launch file from Python to XML.

Summary

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Carlos Agüero <[email protected]>
@caguero caguero marked this pull request as ready for review November 22, 2024 20:40
Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When RViz is opened the position of the camera is in the wrong position.

My suggestions here:

  • The sdf file that we are using it's from gz-sim, and we need to define in the camera sensor the gz_frame_id to camera_optical
  • Then we need to add a static transfrom
<node pkg="tf2_ros" exec="static_transform_publisher" args="--frame-id camera_link  --child-frame-id camera_link_optical --roll 1.570796327 --yaw 1.570796327" />

Let me know if you need some help and I can open a PR with the suggestions

@caguero
Copy link
Contributor Author

caguero commented Nov 27, 2024

When RViz is opened the position of the camera is in the wrong position.

My RViz camera looks the same as the one in Gazebo. Is this what you're seeing on your side?

Screenshot from 2024-11-27 17-13-08

@caguero
Copy link
Contributor Author

caguero commented Dec 11, 2024

When RViz is opened the position of the camera is in the wrong position.

To minimize changes, I used the default camera sensor frame in the static transform publisher so that we don't need to add any frame id and the example will still work with the default world.

Here's the 3D scene with the updated camera position:

Screenshot from 2024-12-11 17-44-05

@ahcorde ahcorde merged commit 7b11ef8 into ros2 Dec 18, 2024
5 checks passed
@ahcorde ahcorde deleted the caguero/camera_demo_v2 branch December 18, 2024 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants