# astra_camera
The ros_astra_camera package is an OpenNI2 ROS wrapper created for Orbbec 3D cameras.
This package allows the usage of Orbbec 3D cameras with ROS Kinetic, Melodic, and Noetic distributions
## Install dependencies
### ROS
- Please refer directly to ROS [wiki](http://wiki.ros.org/ROS/Installation).
### other dependencies
- Install dependencies (be careful with your ROS distribution)
```bash
# Assuming you have sourced the ros environment, same below
sudo apt install libgflags-dev ros-$ROS_DISTRO-image-geometry ros-$ROS_DISTRO-camera-info-manager\
ros-$ROS_DISTRO-image-transport ros-$ROS_DISTRO-image-publisher libgoogle-glog-dev libusb-1.0-0-dev libeigen3-dev
```
- Install libuvc.
```bash
git clone https://github.com/libuvc/libuvc.git
cd libuvc
mkdir build && cd build
cmake .. && make -j4
sudo make install
sudo ldconfig
```
## Getting start
- Create a ros workspace( if you don't have one).
```bash
mkdir -p ~/ros_ws/src
```
- Clone code from github.
```bash
cd ~/ros_ws/src
git clone https://github.com/orbbec/ros_astra_camera.git
```
- Build
```bash
cd ~/ros_ws
catkin_make
```
- Install udev rules.
```bash
cd ~/ros_ws
source ./devel/setup.bash
roscd astra_camera
./scripts/create_udev_rules
sudo udevadm control --reload && sudo udevadm trigger
```
Start the camera
- In terminal 1
```bash
source ./devel/setup.bash
roslaunch astra_camera astra.launch
```
- In terminal 2
```bash
source ./devel/setup.bash
rviz
```
Select the topic you want to display
- Check topics / services/ parameters (open a new terminal)
```bash
rostopic list
rosservice list
rosparam list
```
- Check camera extrinsic parameter(from depth to color)
```bash
rostopic echo /camera/extrinsic/depth_to_color
```
- Get camera parameter
```bash
rosservice call /camera/get_camera_params "{}"
```
- Check camera parameter, please refer to the ROS documentation for the meaning of the specific fields of the camera
parameter [camera info](http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/CameraInfo.html)
```bash
rostopic echo /camera/depth/camera_info
rostopic echo /camera/color/camera_info
```
- Check device information
```bash
rosservice call /camera/get_device_info "{}"
```
- Get the SDK version (Include firmware and OpenNI version )
```bash
rosservice call /camera/get_version "{}"
```
- Set/get (auto) exposure
```bash
rosservice call /camera/set_color_auto_exposure '{data: false}'
rosservice call /camera/set_uvc_auto_exposure '{data: false}'
rosservice call /camera/set_ir_auto_exposure "{data: false}"
# Setting exposure values (Be careful with the data range, the following example may not be correct.)
rosservice call /camera/set_ir_exposure "{data: 2000}"
roservice call /camera/set_color_exposure "{data: 2000}"
rosservice call /camera/set_uvc_exposure "{data: 2000}"
# Get exposure
rosservice call /camera/get_ir_exposure "{}"
rosservice call /camera/get_color_exposure "{}"
rosservice call /camera/get_uvc_exposure "{}"
```
- Set/get gain
```bash
# Get Gain
rosservice call /camera/get_color_gain '{}' # OpenNI camera
rosservice call /camera/get_ir_gain '{}' # OpenNI camera
rosservice call /camera/get_uvc_gain "{}" # UVC camera
# Setting the gain (Be careful with the data range, the following example may not be correct.)
rosservice call /camera/set_color_gain "{data: 200}"
rosservice call /camera/set_ir_gain "{data: 200}"
roservice call /camera/set_uvc_gain "{data: 200}"
```
- Set/get mirror
```bash
rosservice call /camera/set_color_mirror "{data: true}"
rosservice call /camera/set_depth_mirror "{data: true}"
rosservice call /camera/set_ir_mirror "{data: true}"
rosservice call /camera/set_uvc_mirror "{data: true}"
```
- Set/get (auto) white balance
```bash
rosservice call /camera/set_uvc_auto_white_balance "{data: false}"
#(Be careful with the data range, the following example may not be correct.)
rosservice call /camera/set_uvc_white_balance "{data: 200}"
```
- Turn on/off laser
```bash
rosservice call /camera/set_laser '{data: true}' # Turn on
rosservice call /camera/set_laser '{data: false}' # Turn off
```
- Turn on/off fans
```bash
rosservice call /camera/set_fan '{data: true}' # Turn on
rosservice call /camera/set_fan '{data: false}' # Turn off
```
- Turn on/off LDP
```bash
rosservice call /camera/set_ldp '{data: true}'
rosservice call /camera/set_ldp '{data: false}'
```
- Turn on/off sensors
```bash
rosservice call /camera/toggle_ir "{data: true}"
rosservice call /camera/toggle_color "{data: true}"
rosservice call /camera/toggle_depth "{data: true}"
rosservice call /camera/toggle_uvc_camera "{data : true}"
```
- Save image
```bash
rosservice call /camera/save_images "{}"
```
For dabai and dabai dcw (RGB camera is UVC protocol), run:
```bash
rosservice call /camera/save_uvc_image "{}"
```
NOTE: The images are saved under ~/.ros/image and are only available when the sensor is on.
- Save point cloud
```bash
rosservice call /camera/save_point_cloud_xyz "{}" # xyz
rosservice call /camera/save_point_cloud_xyz_rgb "{}" # xyzrgb
```
NOTE: Point cloud are only available if it is running and saved under ~/.ros/point_cloud.
### **Multiple cameras**
- First, you need to enumerate the serial number of the camera, plug in the cameras,
and run the following command:
```bash
roslaunch astra_camera list_devices.launch
```
- **Set the parameter `device_num` to the number of cameras**
- Next, go to ros_astra_camera/launch/multi_xxx.launch and change the serial number. Currently, the different cameras can only be distinguished by the serial number.
```
<launch>
<!-- unique camera name-->
<arg name="camera_name" default="camera"/>
<!-- Hardware depth registration -->
<arg name="3d_sensor" default="astra"/>
<!-- stereo_s_u3, astrapro, astra -->
<arg name="camera1_prefix" default="01"/>
<arg name="camera2_prefix" default="02"/>
<arg name="camera1_serila_number" default="AALXB1301YW"/>
<arg name="camera2_serila_number" default="AD7J7230031"/>
<arg name="device_num" default="2"/>
<include file="$(find astra_camera)/launch/$(arg 3d_sensor).launch">
<arg name="camera_name" value="$(arg camera_name)_$(arg camera1_prefix)"/>
<arg name="serial_number" value="$(arg camera1_serila_number)"/>
<arg name="device_num" value="$(arg device_num)"/>
</include>
<include file="$(find astra_camera)/launch/$(arg 3d_sensor).launch">
<arg name="camera_name" value="$(arg camera_name)_$(arg camera2_prefix)"/>
<arg name="serial_number" value="$(arg camera2_serila_number)"/>
<arg name="device_num" value="$(arg device_num)"/>
</include>
<node pkg="tf2_ros" type="static_transform_publisher" name="camera_tf" args="0 0 0 0 0 0 camera01_link camera02_link"/>
</launch>
```
- The Astra camera will use a semaphore for process synchronization. If the camera fails to start, the semaphore file may be left in the /dev/shm, causing the next start to get stuck. To prevent this issue, please run the following command before launching:
```bash
rosrun astra_camera cleanup_shm_node
```
This command will clean up all semaphore files in the /dev/shm directory, ensuring that the camera will not get stuck during the next start.
- Launch
``` bash
roslaunch astra_camera multi_astra.launch
```
## Use calibration camera parameter
- Set camera info uri, Go to `xxx.launch`
```xml
<launch>
<!--...-->
<arg name="ir_info_uri" default="file:///you_ir_camera_calib_path/depth_camera.yaml"/>
<arg name="color_info_uri" default="file:///you_depth_camera_calib_path/rgb_camera.yaml"/>
<!--...-->
</launch>
```
- calibration file should like
```yaml
image_width: 640
image_height: 480
# The camera name is fixed. The color camera is rgb_camera, the depth/IR camera name is ir_camera
camera_name: rgb_camera
camera_matrix:
rows: 3
cols: 3
data: [517.301, 0, 326.785, 0, 519.291, 244.563, 0,
奥比中光Astra驱动安装包
需积分: 0 79 浏览量
更新于2024-05-25
收藏 5.24MB ZIP 举报
奥比中光Astra驱动安装包是一款专为奥比中光Astra系列3D摄像头设计的驱动程序,它使得该型号的摄像头能够在计算机系统上正常运行并发挥其功能。驱动程序在计算机硬件与操作系统之间起着桥梁的作用,允许操作系统识别和控制硬件设备,因此对于Astra摄像头来说,安装正确的驱动至关重要。
这款驱动主要服务于开发者和使用者,帮助他们实现3D摄像头的数据采集、图像处理和应用开发。在机器人操作系统(ROS,Robot Operating System)环境下,Astra摄像头的驱动能够提供必要的接口和服务,使得开发者能够轻松集成摄像头到他们的机器人解决方案中。
在"ros_astra_camera-main"这个压缩包文件中,通常会包含以下内容:
1. **源代码**:这部分代码实现了ROS节点,用于与Astra摄像头通信,读取数据,并将其转换为ROS消息格式。这通常包括C++或Python的源文件,以及对应的Makefile或CMakeLists.txt构建文件。
2. **配置文件**:这些文件包含了ROS节点的配置参数,如摄像头的帧率、分辨率等。用户可以通过修改这些参数来调整摄像头的性能。
3. **消息定义**:ROS系统中的消息类型定义,用于描述从摄像头获取的数据结构,如图像、深度图等。
4. **服务文件**:定义了ROS服务,允许用户通过服务调用来控制摄像头的某些功能,如开启、关闭、更改设置等。
5. **节点启动脚本**:通常为`.launch`文件,用于启动ROS节点,连接摄像头,并进行必要的初始化设置。
6. **README文档**:提供了安装、配置和使用驱动的详细指南,包括编译步骤、依赖库的安装以及如何在ROS环境中运行摄像头节点。
7. **示例代码**:可能包含一些简单的示例,演示如何使用ROS接口与Astra摄像头交互,如显示图像、处理深度数据等。
在安装和使用过程中,用户需要确保他们的系统已经安装了ROS和所有必要的依赖库。安装驱动通常包括解压文件、编译源码、安装生成的包以及启动ROS节点。在ROS环境中,可以使用`roslaunch`命令来启动与Astra摄像头相关的节点。
奥比中光Astra驱动安装包是ROS环境下的一个重要组件,为开发者提供了一个与Astra摄像头交互的平台,从而能够在机器人研究、自动化和计算机视觉等领域发挥其3D感知能力。正确安装和配置此驱动,能极大地提升开发效率并优化系统性能。

资深可爱鉴定师
- 粉丝: 73
最新资源
- 基于PID算法的电机转速控制系统的设计.doc
- 2023年数据库四级.doc
- 2023年计算机考试题模拟新版.doc
- 鼎亚数字小区数字高清网络监控系统设计方案.doc
- SSLVPN使用手册.doc
- 软件有限公司文档评审流程.docx
- 民办高校转型与校企项目结合的电气自动化实践教学体系研究优秀获奖科研论文.docx
- 高速光模块在通讯网络的应用解决方案.doc
- 计算机培训心得体会的范文.docx
- 企业实现网络营销策略具有重要意义.docx
- 第二章-电子商务经营模式.ppt
- 人工神经网络专业知识.pptx
- 统考计算机选择题(含答案).doc
- 互联网UI设计师英文简历模板.docx
- 公司三方物流业务信息化解决方案.docx
- 云计算平台搭建方案.doc