{"id":33136985,"url":"https://github.com/orbbec/ros_astra_camera","last_synced_at":"2025-11-16T16:01:52.957Z","repository":{"id":40625791,"uuid":"58611748","full_name":"orbbec/ros_astra_camera","owner":"orbbec","description":"ROS wrapper for Astra camera","archived":false,"fork":false,"pushed_at":"2025-06-05T03:11:06.000Z","size":28597,"stargazers_count":95,"open_issues_count":81,"forks_count":36,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-06-05T06:05:35.155Z","etag":null,"topics":["3dcamera","robot","ros","sensor"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orbbec.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-12T05:50:25.000Z","updated_at":"2025-06-05T03:11:08.000Z","dependencies_parsed_at":"2023-12-06T08:45:13.054Z","dependency_job_id":"e63ed670-ead5-4acd-8d54-ad52e700f50b","html_url":"https://github.com/orbbec/ros_astra_camera","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/orbbec/ros_astra_camera","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbbec%2Fros_astra_camera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbbec%2Fros_astra_camera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbbec%2Fros_astra_camera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbbec%2Fros_astra_camera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbbec","download_url":"https://codeload.github.com/orbbec/ros_astra_camera/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbbec%2Fros_astra_camera/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284734138,"owners_count":27054622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3dcamera","robot","ros","sensor"],"created_at":"2025-11-15T11:00:34.746Z","updated_at":"2025-11-16T16:01:52.947Z","avatar_url":"https://github.com/orbbec.png","language":"C++","funding_links":[],"categories":["Network and Middleware"],"sub_categories":["Sensor and Acuator Interfaces"],"readme":"# astra_camera\n\nThe ros_astra_camera package is an OpenNI2 ROS wrapper created for Orbbec 3D cameras.\nThis package allows the usage of Orbbec 3D cameras with ROS Kinetic, Melodic, and Noetic distributions\n\n## Install dependencies\n\n### ROS\n\n- Please refer directly to ROS [wiki](http://wiki.ros.org/ROS/Installation).\n\n### other dependencies\n\n- Install dependencies (be careful with your ROS distribution)\n\n  ```bash\n  # Assuming you have sourced the ros environment, same below\n  sudo apt install libgflags-dev  ros-$ROS_DISTRO-image-geometry ros-$ROS_DISTRO-camera-info-manager\\\n  ros-$ROS_DISTRO-image-transport ros-$ROS_DISTRO-image-publisher  libusb-1.0-0-dev libeigen3-dev\n  ros-$ROS_DISTRO-backward-ros libdw-dev\n  ```\n\n- Install libuvc.\n\n  ```bash\n  git clone https://github.com/libuvc/libuvc.git\n  cd libuvc\n  mkdir build \u0026\u0026 cd build\n  cmake .. \u0026\u0026 make -j4\n  sudo make install\n  sudo ldconfig\n  ```\n\n## Getting start\n\n- Create a ros workspace( if you don't have one).\n\n```bash\nmkdir -p ~/ros_ws/src\n```\n\n- Clone code from github.\n\n```bash\n cd ~/ros_ws/src\n git clone https://github.com/orbbec/ros_astra_camera.git\n```\n\n- Build\n\n```bash\ncd ~/ros_ws\ncatkin_make\n```\n\n- Install udev rules.\n\n```bash\ncd ~/ros_ws\nsource ./devel/setup.bash\nroscd astra_camera\n./scripts/create_udev_rules\nsudo udevadm control --reload \u0026\u0026 sudo  udevadm trigger\n```\n\nStart the camera\n\n- In terminal 1\n\n```bash\nsource ./devel/setup.bash \nroslaunch astra_camera astra.launch\n```\n\n- In terminal 2\n\n```bash\nsource ./devel/setup.bash\nrviz\n```\n\nSelect the topic you want to display\n\n- Check topics / services/ parameters (open a new terminal)\n\n```bash\nrostopic list\nrosservice list\nrosparam list\n```\n\n- Check camera extrinsic parameter(from depth to color)\n\n```bash\nrostopic echo /camera/extrinsic/depth_to_color\n\n```\n\n- Get camera parameter\n\n```bash\nrosservice call /camera/get_camera_params \"{}\"\n```\n\n- Check camera parameter, please refer to the ROS documentation for the meaning of the specific fields of the camera\n  parameter [camera info](http://docs.ros.org/en/melodic/api/sensor_msgs/html/msg/CameraInfo.html)\n\n```bash\nrostopic echo /camera/depth/camera_info\nrostopic echo /camera/color/camera_info\n```\n\n- Check device information\n\n```bash\nrosservice call /camera/get_device_info \"{}\" \n```\n\n- Get the SDK version (Include firmware and OpenNI version )\n\n```bash\nrosservice call /camera/get_version \"{}\"\n```\n\n- Set/get (auto) exposure\n\n```bash\nrosservice call /camera/set_color_auto_exposure '{data: false}' \nrosservice call /camera/set_uvc_auto_exposure  '{data: false}'\nrosservice call /camera/set_ir_auto_exposure  \"{data: false}\"\n    \n# Setting exposure values (Be careful with the data range, the following example may not be correct.)\nrosservice call /camera/set_ir_exposure  \"{data: 2000}\"\nroservice call /camera/set_color_exposure  \"{data: 2000}\"\nrosservice call /camera/set_uvc_exposure  \"{data: 2000}\"\n # Get exposure\n rosservice call /camera/get_ir_exposure  \"{}\"\n rosservice call /camera/get_color_exposure \"{}\"\n rosservice call /camera/get_uvc_exposure \"{}\"\n```\n\n- Set/get gain\n\n```bash\n# Get Gain\nrosservice call /camera/get_color_gain '{}' # OpenNI camera\nrosservice call /camera/get_ir_gain '{}' # OpenNI camera\nrosservice call /camera/get_uvc_gain \"{}\" # UVC camera\n# Setting the gain (Be careful with the data range, the following example may not be correct.)\nrosservice call /camera/set_color_gain  \"{data: 200}\"\nrosservice call /camera/set_ir_gain \"{data: 200}\"\nroservice call /camera/set_uvc_gain \"{data: 200}\"\n```\n\n- Set/get mirror\n\n```bash\nrosservice call /camera/set_color_mirror  \"{data: true}\"\nrosservice call /camera/set_depth_mirror  \"{data: true}\"\nrosservice call /camera/set_ir_mirror  \"{data: true}\"\nrosservice call /camera/set_uvc_mirror  \"{data: true}\"\n```\n\n- Set/get (auto) white balance\n\n```bash\nrosservice call /camera/set_uvc_auto_white_balance  \"{data: false}\"\n#(Be careful with the data range, the following example may not be correct.)\nrosservice call /camera/set_uvc_white_balance  \"{data: 200}\"\n```\n\n- Turn on/off laser\n\n```bash\nrosservice call /camera/set_laser '{data: true}' # Turn on\nrosservice call /camera/set_laser '{data: false}' # Turn off\n```\n\n- Turn on/off fans\n\n```bash\n rosservice call /camera/set_fan  '{data: true}' # Turn on\n rosservice call /camera/set_fan  '{data: false}' # Turn off\n```\n\n- Turn on/off LDP\n\n```bash\nrosservice call /camera/set_ldp '{data: true}'\nrosservice call /camera/set_ldp '{data: false}'\n```\n\n- Turn on/off sensors\n\n```bash\nrosservice call  /camera/toggle_ir \"{data: true}\"\nrosservice call  /camera/toggle_color \"{data: true}\"\nrosservice call  /camera/toggle_depth \"{data: true}\"\nrosservice call  /camera/toggle_uvc_camera \"{data : true}\"\n```\n\n- Save image\n\n```bash\nrosservice call /camera/save_images \"{}\"\n```\n\nFor dabai and dabai dcw (RGB camera is UVC protocol), run:\n\n```bash\nrosservice call /camera/save_uvc_image \"{}\" \n```\n\nNOTE: The images are saved under ~/.ros/image and are only available when the sensor is on.\n\n- Save point cloud\n\n```bash\nrosservice call /camera/save_point_cloud_xyz \"{}\" # xyz\nrosservice call /camera/save_point_cloud_xyz_rgb \"{}\" # xyzrgb\n```\n\nNOTE: Point cloud are only available if it is running and saved under ~/.ros/point_cloud.\n\n### **Multiple cameras**\n\n- First, you need to enumerate the serial number of the camera, plug in the cameras,\nand run the following command:\n\n  ```bash\n  roslaunch astra_camera list_devices.launch  \n  ```\n\n- **Set the parameter `device_num` to the number of cameras**\n\n- 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.\n\n```\n  \u003claunch\u003e\n    \u003c!-- unique camera name--\u003e\n    \u003carg name=\"camera_name\" default=\"camera\"/\u003e\n    \u003c!-- Hardware depth registration --\u003e\n    \u003carg name=\"3d_sensor\" default=\"astra\"/\u003e\n    \u003c!-- stereo_s_u3, astrapro, astra --\u003e\n    \u003carg name=\"camera1_prefix\" default=\"01\"/\u003e\n    \u003carg name=\"camera2_prefix\" default=\"02\"/\u003e\n    \u003carg name=\"camera1_serila_number\" default=\"AALXB1301YW\"/\u003e\n    \u003carg name=\"camera2_serila_number\" default=\"AD7J7230031\"/\u003e\n    \u003carg name=\"device_num\" default=\"2\"/\u003e\n    \u003cinclude file=\"$(find astra_camera)/launch/$(arg 3d_sensor).launch\"\u003e\n        \u003carg name=\"camera_name\" value=\"$(arg camera_name)_$(arg camera1_prefix)\"/\u003e\n        \u003carg name=\"serial_number\" value=\"$(arg camera1_serila_number)\"/\u003e\n        \u003carg name=\"device_num\" value=\"$(arg device_num)\"/\u003e\n    \u003c/include\u003e\n\n    \u003cinclude file=\"$(find astra_camera)/launch/$(arg 3d_sensor).launch\"\u003e\n        \u003carg name=\"camera_name\" value=\"$(arg camera_name)_$(arg camera2_prefix)\"/\u003e\n        \u003carg name=\"serial_number\" value=\"$(arg camera2_serila_number)\"/\u003e\n        \u003carg name=\"device_num\" value=\"$(arg device_num)\"/\u003e\n    \u003c/include\u003e\n    \u003cnode pkg=\"tf2_ros\" type=\"static_transform_publisher\" name=\"camera_tf\" args=\"0 0 0 0 0 0 camera01_link camera02_link\"/\u003e\n\u003c/launch\u003e\n\n```\n\n- 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:\n\n```bash\nrosrun astra_camera cleanup_shm_node \n```\n\nThis command will clean up all semaphore files in the /dev/shm directory, ensuring that the camera will not get stuck during the next start.\n\n- Launch\n\n``` bash\nroslaunch astra_camera multi_astra.launch\n```\n\n## Use calibration camera parameter\n\n- Set camera info uri, Go to `xxx.launch`\n\n```xml\n\n\u003claunch\u003e\n    \u003c!--...--\u003e\n    \u003carg name=\"ir_info_uri\" default=\"file:///you_ir_camera_calib_path/depth_camera.yaml\"/\u003e\n    \u003carg name=\"color_info_uri\" default=\"file:///you_depth_camera_calib_path/rgb_camera.yaml\"/\u003e\n    \u003c!--...--\u003e\n\u003c/launch\u003e\n```\n\n- calibration file should like\n\n```yaml\nimage_width: 640\nimage_height: 480\n# The camera name is fixed. The color camera is rgb_camera, the depth/IR camera name is ir_camera\ncamera_name: rgb_camera\ncamera_matrix:\n  rows: 3\n  cols: 3\n  data: [517.301, 0, 326.785, 0, 519.291, 244.563, 0, 0, 1]\ndistortion_model: plumb_bob\ndistortion_coefficients:\n  rows: 1\n  cols: 5\n  data: [-0.41527, 0.31874, -0.00197, 0.00071, 0]\nrectification_matrix:\n  rows: 3\n  cols: 3\n  data: [0.999973, 0.00612598, -0.00406652, -0.00610201, 0.999964, 0.00588094, 0.0041024, -0.00585596, 0.999974 ]\nprojection_matrix:\n  rows: 3\n  cols: 4\n  data: [517.301, 0, 326.785, -25.3167, 0, 519.291, 244.563, 0.282065, 0, 0, 1, 0.0777703]\n\n```\n\n## Launch parameters\n\n- `connection_delay`:The delay time for reopening the device in milliseconds. Some devices may take longer to initialize, such as the Astra mini. Reopening the device immediately may cause firmware crashes when hot plugging.\n- `enable_point_cloud`: Whether to enable point cloud..\n- `enable_point_cloud_xyzrgb`,:Whether to enable RGB point cloud.\n- `enable_d2c_viewer`: Publish D2C overlay image(For testing only).\n- `device_num`: The number of devices. You need to specify the number of devices when using multiple cameras.\n- `enable_reconfigure`, Whether to enable ROS [dynamic configuration](http://wiki.ros.org/dynamic_reconfigure) changes,\n  set to false means that the `Astra.cfg` configuration will not take effect. This is recommended for testing purposes only. Turn it off when in use.\n  use. .\n- `color_width`， `color_height`， `color_fps`:  Color stream resolution and frame rate.\n- `ir_width`， `ir_height`， `ir_fps`:IR stream resolution and frame rate.\n- `depth_width`， `depth_height`， `depth_fps`: Depth stream resolution and frame rate.\n- `enable_color`: Whether to enable RGB camera. This parameter has no effect when the RGB camera is using the UVC protocol.\n- `enable_depth` : Whether to enable the depth camera.\n- `enable_ir`: Whether to enable the IR camera.\n- `depth_align`: Enables hardware depth to color alignment, which is required when the RGB point cloud is enabled.\n- `depth_scale`: Depth image zoom scale. For example, setting it to 2 means aligning a depth image of size 320x240 to an RGB image of size 640x480.\n- `color_roi_x`， `color_roi_y`， `color_roi_width`， `color_roi_height`:: Whether to crop RGB images. The default is -1, which is only used when the RGB resolution is greater than the depth resolution and needs to be aligned. For example, if you need to align a depth image of size 640x400 to an RGB image of size 640x480, you need to set `color_roi_x` to 0, `color_roi_y` to 0, `color_roi_width` to 640, and `color_roi_height` to 400. This will crop the top 400 pixels of the RGB image with a corresponding depth ROI.\n- `color_depth_synchronization`，Enable synchronization of RGB with depth\n- `use_uvc_camera`: If the RGB camera is using the UVC protocol, set this parameter to true. UVC is the protocol that currently includes Dabai, Dabai_dcw, and so on.\n- `uvc_product_id`:PID of the UVC camera.\n- `uvc_camera_format`:Image format for the UVC camera.\n- `uvc_retry_count` : Sometimes the UVC protocol camera does not reconnect successfully when hot plugging, requiring many retries.\n- `enable_publish_extrinsic` Enable publishing camera extrinsic.\n- `oni_log_level`:  Log levels for OpenNI: `verbose`, `info`, `warning`, `error`, or `none`.\n- `oni_log_to_console`, Whether to output OpenNI logs to the console.\n- `oni_log_to_file`:Whether to output OpenNI logs to a file. By default, it will be saved in the Log folder under the path of the currently running program.\n- For special customer requirements:\n  - `enable_keep_alive`,  Whether to send heartbeat packets to the firmware. This is not enabled by default.\n  - `keep_alive_interval`, The time interval in seconds between sending heartbeat packets.\n\n## Frequently Asked Questions\n\n- No image when multiple cameras\n  - Maybe the the power supply is not sufficient, consider to connect the camera with a powered USB hub.\n  - Maybe the the resolution is too high, lower the resolution to test\n- Hot-plug image anomaly\n  - The `connection_delay` parameter can be increased because some devices take longer to initialize and may not have completed the initialization of the device.\n- No image when hot-plugging\n  - Check if the data cable is plugged in properly.\n  - Try connecting the camera to a powered USB hub. The ARM development board may have an unstable power supply, causing the device to fail to reopen.\n- Launching the camera gets stuck:\n\n  - t is highly likely that the camera failed to start the last time. The Astra camera uses a semaphore to do process synchronization. If it fails to start, the semaphore file may be left in the `/dev/shm`, resulting in the next start being stuck. Just run `rosrun astra_camera cleanup_shm_node`, and the problem should be resolved..\n\n- The point cloud's frame rate is very low. Consider increasing it by adding a core recv buffer:\n\n   ```bash\n    sudo sysctl -w net.core.rmem_max=8388608 net.core.rmem_default=8388608\n   ```\n\n## License\n\nCopyright 2023 Orbbec Ltd.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this project except in compliance with\nthe License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"\nAS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific\nlanguage governing permissions and limitations under the License.\n\n*Other names and brands may be claimed as the property of others*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbbec%2Fros_astra_camera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbbec%2Fros_astra_camera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbbec%2Fros_astra_camera/lists"}