0
$\begingroup$

Rosanswers logo

Hi All,

How would I add/attach camera to a model (like a cylinder which is defined in the world file) in Gazebo? I know how to add camera to a robot link. But I want to add camera to a standalone model defined in the world file.

Thank You,


Originally posted by nihalar on ROS Answers with karma: 11 on 2020-06-18

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi @nihalar,

The short answer: Like the same way you add a camera to any robot model.

The long answer: Is related to the way you use to generate your world. In order to add a camera to a (static) Gazebo model you will need to include the model in the sdf world. Moreover, if you have a xacro macro with the camera you may just copy the model and included in an empty world. In your case you will need to define a cylinder link and attach it to a camera link in which you will define your camera sensor with the appropiate plugin.

gazebo_ros_pkgs contains exactly what you want in a demo world. This demo world simulates a bounding ball in front of a camera and publish the camera frames over a ROS topic.

For more information about the (camera) gazebo plugin you can check this tutorial.

Cheers.


Originally posted by Weasfas with karma: 1695 on 2020-06-18

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.