-
Notifications
You must be signed in to change notification settings - Fork 64
Camera feed and depth camera
These features only work on Linux with ROS installed. Additionally, you should have the following packages installed on your system.
cv-bridge # Can be installed via apt install ros-<version>-cv-bridge
image-transport # Can be installed via apt install ros-<version>-image-transport
Once these packages are installed, you can rebuild ambf to automatically enable support.
Now you can edit your world.yaml
file that contains the cameras for which you want to enable camera feed and/or depth pointcloud publishing.
The default world file is located here: https://github.com/WPI-AIM/ambf/blob/ambf-1.0/ambf_models/descriptions/world/world.yaml
Inspecting its contents:
enclosure size: {length: 10.0, width: 10.0, height: 3.0}
lights: [light1]
cameras: [camera1] # You can see, we are going to load a camera called camera1 which is defined later in this file
environment: "./checkered_floor.yaml"
namespace: /ambf/env/
max iterations: 50
gravity: {x: 0.0, y: 0.0, z: -9.81}
...
...
camera1:
namespace: cameras/
name: default_camera
location: {x: 4.0, y: 0.0, z: 2.0}
look at: {x: 0.0, y: 0.0, z: -0.5}
up: {x: 0.0, y: 0.0, z: 1.0}
clipping plane: {near: 0.1, far: 10.0}
field view angle: 0.8
monitor: 0
# multipass: True
# publish image: True
# publish image interval: 1 # Publish every nth scene update
# publish depth: True
# publish depth interval: 10 # Publish every nth scene update
By uncommenting/adding the following line, we can enable camera feed publishing
publish image: True
# publish image interval: 1 # Publish every nth scene update. Default 1
and by uncommenting this field, we can enable depth pointcloud computation and publishing
publish depth: True
# publish depth interval: 10 # Publish every nth scene update. Default 10
The camera feed is published to the following topic:
/<namespace>/<camera_name>/ImageData/*
and the depth pointcloud is published to the following topics:
/<namespace>/<camera_name>/DepthData/
You can also view either topic in RViz
.
Here is an example image:
The AMBF Simulator
Introduction
- Installing AMBF
- Launching the Simulator
- Selecting Robot(s) to Launch
- The Python Client
- Understanding the Input Device Specification
- Understanding Command Line Arguments
- Keyboard and Mouse Shortcuts
- Mouse Control Multipliers
Useful Tools
Concepts:
- Collision Filtering
- Preprocessing Shaders
- Publishing Camera Feed and Depth Point Cloud
- Setting Per Object or Per Model Level Gravity:
Examples