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

How to add a camera as FPV? #143

Open
Swesser opened this issue Oct 17, 2024 · 3 comments
Open

How to add a camera as FPV? #143

Swesser opened this issue Oct 17, 2024 · 3 comments

Comments

@Swesser
Copy link

Swesser commented Oct 17, 2024

Not an issue, just a noob question. How to add a FPV camera to iris_with_standoffs? and how to see the video? struggling a little bit...

p.s. using gazebo with betaflight. I have managed to import environment from Null Island into betaflight's world for testing, but now i can't understand what to do next, please help...

@Swesser
Copy link
Author

Swesser commented Dec 8, 2024

added the following to the model, and you can get the camera image in the "Image View" in Gazebo's GUI.

<!-- FPV Camera -->
<link name='cam_link'>
  <pose frame=''>0.118317 0.002195 0.004205 -0 -0 -0</pose>
  <inertial>
    <mass>0.0001</mass>
    <inertia>
      <ixx>1e-7</ixx>
	  <ixy>0</ixy>
	  <ixz>0</ixz>
	  <iyy>1e-7</iyy>
	  <iyz>0</iyz>
	  <izz>1e-7</izz>
    </inertia>
    <pose frame=''>0 0 0 0 -0 0</pose>
  </inertial>
  <self_collide>0</self_collide>
  <kinematic>0</kinematic>
  <sensor name='camera1' type='camera'>
    <camera name="head">
      <horizontal_fov>1.3962634</horizontal_fov>
      <image>
        <width>800</width>
        <height>800</height>
        <format>R8G8B8</format>
      </image>
      <clip>
        <near>0.02</near>
        <far>300</far>
      </clip>
    </camera>
    <always_on>1</always_on>
    <update_rate>30</update_rate>
    <visualize>1</visualize>
    <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
      <alwaysOn>true</alwaysOn>
      <updateRate>0.0</updateRate>
      <cameraName>iris/camera</cameraName>
      <imageTopicName>image_raw</imageTopicName>
      <cameraInfoTopicName>camera_info</cameraInfoTopicName>
      <frameName>camera_link</frameName>
      <hackBaseline>0.07</hackBaseline>
      <distortionK1>0.0</distortionK1>
      <distortionK2>0.0</distortionK2>
      <distortionK3>0.0</distortionK3>
      <distortionT1>0.0</distortionT1>
      <distortionT2>0.0</distortionT2>
    </plugin>
  </sensor>
</link>

<joint name='camera_joint' type='fixed'>
<parent>base_link</parent>
<child>cam_link</child>
<pose>0 0 0 0 0 0</pose>
</joint>

However, thou there is a ros topic "/iris_with_standoffs/fpv_camera/image" the topic is empty. Probably because of the faulty gz bridge. I have tried to re-compile the bridge and dependent packages, no result. Any help appreciated...

@Swesser
Copy link
Author

Swesser commented Dec 8, 2024

Also, I get this error

[ruby $(which gz) sim-1] [Err] [SystemLoader.cc:119] Failed to load system plugin: (Reason: Could not find shared library)
[ruby $(which gz) sim-1] - Requested plugin name: [camera_controller]
[ruby $(which gz) sim-1] - Requested library name: [libgazebo_ros_camera.so]

no idea why, working on it...

@Swesser
Copy link
Author

Swesser commented Dec 15, 2024

the camera is available in the "Image DIsplay" inside Sim GUI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant