# 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,
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
vslam-orbbec-camera-astra-pro (625个子文件)
libDepthUtils.a 15KB
libDepthUtils.a 14KB
libDepthUtils.a 12KB
Platform.Arm 493B
Platform.Arm 493B
Platform.Arm 493B
Platform.Arm 493B
Platform.Arm 493B
Platform.Arm 493B
Platform.Arm 493B
Platform.Arm 493B
Platform.Arm 493B
OpenNILogo.bmp 21KB
ctrl-gen.c 56KB
device.c 53KB
stream.c 47KB
frame.c 14KB
diag.c 14KB
frame-mjpeg.c 8KB
example.c 7KB
ctrl.c 6KB
init.c 5KB
test.c 4KB
misc.c 2KB
Astra.cfg 6KB
.clang-format 4KB
ClosestPointViewer 21KB
FindOpenCVPkg.cmake 2KB
FindJpegPkg.cmake 2KB
FindLibUSB.cmake 1KB
libuvcConfig.cmake 473B
CommonCppMakefile 5KB
CommonCppMakefile 5KB
CommonCppMakefile 5KB
CommonCppMakefile 5KB
CommonCppMakefile 5KB
CommonCppMakefile 5KB
CommonCppMakefile 5KB
CommonCppMakefile 5KB
CommonJavaMakefile 2KB
doxygen.conf 97KB
config 263B
config 261B
ob_camera_node.cpp 33KB
uvc_camera_driver.cpp 28KB
ros_service.cpp 27KB
ob_camera_info.cpp 13KB
point_cloud_xyzrgb.cpp 12KB
ob_camera_node_factory.cpp 11KB
Viewer.cpp 9KB
Viewer.cpp 9KB
Viewer.cpp 7KB
utils.cpp 7KB
MWClosestPoint.cpp 5KB
point_cloud_xyz.cpp 5KB
main.cpp 4KB
main.cpp 4KB
main.cpp 4KB
main.cpp 3KB
main.cpp 3KB
main.cpp 3KB
ob_context.cpp 3KB
d2c_viewer.cpp 3KB
main.cpp 2KB
list_devices_node.cpp 2KB
main.cpp 1KB
astra_cleanup_shm_node.cpp 717B
create_udev_rules 353B
doxygen.css 23KB
stylesheet.css 13KB
tabs.css 1KB
Viewer.d 10KB
main.d 9KB
description 73B
description 73B
EventBasedRead 27KB
exclude 240B
exclude 240B
.gitattributes 153B
.gitignore 13KB
.gitignore 48B
.gitkeep 0B
OpenNI.h 94KB
OpenNI.h 92KB
PS1080.h 37KB
utlist.h 36KB
libuvc.h 30KB
SonixCamera.h 20KB
PS1080.h 20KB
OniDriverAPI.h 20KB
OniDriverAPI.h 18KB
OniCAPI.h 14KB
OniCAPI.h 13KB
ob_camera_node.h 12KB
libuvc_internal.h 10KB
PrimeSense.h 8KB
PrimeSense.h 8KB
PSLink.h 8KB
PSLink.h 8KB
OniCTypes.h 7KB
共 625 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- Galahad_23332023-09-08压缩包已损坏
押波张飞
- 粉丝: 466
- 资源: 9
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 126641091882064LSPatch.apk
- 5G网络基础培训课件.zip
- 2024-spring-HIT-CS-大作业
- yolo目标检测项目实验
- downloadFile-1.hc
- C++课程设计:基于Qt的航班信息管理系统
- ADS7822UVerilog驱动,前面传的有点问题
- 基于python的高性能爬虫程序,使用了多线程+缓存+xpath实现的,这里以彼-岸图库为例,实现,仅用于学习交流
- 中分辨率成像光谱仪(MODIS)烧毁面积产品信息MODIS-C6-BA-User-Guide-1.2.pdf
- Screenshot_20240427_172613_com.huawei.browser.jpg
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功