mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-11 06:59:49 +08:00
update to v2.0.7
This commit is contained in:
+745
-745
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
|||||||
# Orbbec ROS2 SDK
|
# Orbbec ROS2 SDK
|
||||||
|
|
||||||
[](http://github.com/badges/stability-badges) 
|
[](http://github.com/badges/stability-badges) 
|
||||||
|
|
||||||
Orbbec SDK ROS 2 is a wrapper for the Orbbec 3D camera that provides seamless integration with the ROS 2 environment. It
|
Orbbec SDK ROS 2 is a wrapper for the Orbbec 3D camera that provides seamless integration with the ROS 2 environment. It
|
||||||
@@ -7,6 +8,7 @@ supports ROS 2 Foxy, Humble, and Jazzy distributions.
|
|||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
<!-- TOC -->
|
<!-- TOC -->
|
||||||
|
|
||||||
* [Orbbec ROS2 SDK](#orbbec-ros2-sdk)
|
* [Orbbec ROS2 SDK](#orbbec-ros2-sdk)
|
||||||
* [Table of Contents](#table-of-contents)
|
* [Table of Contents](#table-of-contents)
|
||||||
* [Installation Instructions](#installation-instructions)
|
* [Installation Instructions](#installation-instructions)
|
||||||
@@ -44,6 +46,7 @@ supports ROS 2 Foxy, Humble, and Jazzy distributions.
|
|||||||
* [Why Are There So Many Launch Files?](#why-are-there-so-many-launch-files)
|
* [Why Are There So Many Launch Files?](#why-are-there-so-many-launch-files)
|
||||||
* [Other useful links](#other-useful-links)
|
* [Other useful links](#other-useful-links)
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
|
|
||||||
<!-- TOC -->
|
<!-- TOC -->
|
||||||
|
|
||||||
## Installation Instructions
|
## Installation Instructions
|
||||||
@@ -203,16 +206,20 @@ You will need to launch a component container and launch our node as a component
|
|||||||
Further details on efficient intra-process communication can be found [here](https://docs.ros.org/en/humble/Tutorials/Intra-Process-Communication.html#efficient-intra-process-communication).
|
Further details on efficient intra-process communication can be found [here](https://docs.ros.org/en/humble/Tutorials/Intra-Process-Communication.html#efficient-intra-process-communication).
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
#### Manually loading multiple components into the same process
|
#### Manually loading multiple components into the same process
|
||||||
|
|
||||||
* Start the component:
|
* Start the component:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ros2 run rclcpp_components component_container
|
ros2 run rclcpp_components component_container
|
||||||
```
|
```
|
||||||
|
|
||||||
* Add the wrapper:
|
* Add the wrapper:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ros2 component load /ComponentManager orbbec_camera orbbec_camera::OBCameraNodeDriver -e use_intra_process_comms:=true
|
ros2 component load /ComponentManager orbbec_camera orbbec_camera::OBCameraNodeDriver -e use_intra_process_comms:=true
|
||||||
```
|
```
|
||||||
|
|
||||||
Load other component nodes (consumers of the wrapper topics) in the same way.
|
Load other component nodes (consumers of the wrapper topics) in the same way.
|
||||||
|
|
||||||
#### Using a launch file
|
#### Using a launch file
|
||||||
@@ -227,6 +234,7 @@ ros2 launch orbbec_camera gemini_intra_process_demo_launch.py
|
|||||||
* Compressed images using `image_transport` will be disabled as this isn't supported with intra-process communication
|
* Compressed images using `image_transport` will be disabled as this isn't supported with intra-process communication
|
||||||
|
|
||||||
## Use V4L2 backend
|
## Use V4L2 backend
|
||||||
|
|
||||||
To enable the V4L2 backend for the Gemini2 series cameras, follow these steps:
|
To enable the V4L2 backend for the Gemini2 series cameras, follow these steps:
|
||||||
|
|
||||||
1. The Gemini2 series cameras support the V4L2 backend.
|
1. The Gemini2 series cameras support the V4L2 backend.
|
||||||
@@ -308,19 +316,18 @@ The following are the launch parameters available:
|
|||||||
attempt to reset the camera up to three times. This setting aims to prevent USB 3.0 devices from being incorrectly
|
attempt to reset the camera up to three times. This setting aims to prevent USB 3.0 devices from being incorrectly
|
||||||
recognized as USB 2.0. It is recommended to set this parameter to `false` when using a USB 2.0 connection to avoid
|
recognized as USB 2.0. It is recommended to set this parameter to `false` when using a USB 2.0 connection to avoid
|
||||||
unnecessary resets.
|
unnecessary resets.
|
||||||
|
|
||||||
- `enable_3d_reconstruction_mode`: Enables 3D reconstruction mode. Default is `false`. When set to `true`, the camera
|
- `enable_3d_reconstruction_mode`: Enables 3D reconstruction mode. Default is `false`. When set to `true`, the camera
|
||||||
laser operates in on-off mode, capturing IR images (laser off) for VSLAM localization and depth images (laser on) for point cloud computation.
|
laser operates in on-off mode, capturing IR images (laser off) for VSLAM localization and depth images (laser on) for point cloud computation.
|
||||||
- `tf_publish_rate`: The rate at which the camera publishes dynamic transforms. The default value is `0.0`, which means static transforms are published.
|
- `tf_publish_rate`: The rate at which the camera publishes dynamic transforms. The default value is `0.0`, which means static transforms are published.
|
||||||
- `time_domain`: The frame time domain, string type, can be `device`, `global`, or `system`. `device` means using the hardware timestamp from the camera,
|
- `time_domain`: The frame time domain, string type, can be `device`, `global`, or `system`. `device` means using the hardware timestamp from the camera,
|
||||||
`system` means using the timestamp when the PC received the first packet of data or frame, and `global` is used for synchronized time across multiple
|
`system` means using the timestamp when the PC received the first packet of data or frame, and `global` is used for synchronized time across multiple
|
||||||
devices, aligning data from different sources to a common time base.
|
devices, aligning data from different sources to a common time base.
|
||||||
- `enable_sync_host_time`: Enables synchronization of the host time with the camera time. The default value is `true`, if
|
- `enable_sync_host_time`: Enables synchronization of the host time with the camera time. The default value is `true`, if
|
||||||
use global time, set to `false`. Some old devices may not support this feature.
|
use global time, set to `false`. Some old devices may not support this feature.
|
||||||
- `config_file_path`: The path to the YAML configuration file. The default value is `""`. If the configuration file is not specified,
|
- `config_file_path`: The path to the YAML configuration file. The default value is `""`. If the configuration file is not specified,
|
||||||
the default parameters from the launch file will be used. If you want to use a custom configuration file, please refer to `gemini_330_series.launch.py`.
|
the default parameters from the launch file will be used. If you want to use a custom configuration file, please refer to `gemini_330_series.launch.py`.
|
||||||
`enable_heartbeat` enables the heartbeat function, which is set to `false` by default. If set to `true`, the camera node will send heartbeat signals to
|
`enable_heartbeat` enables the heartbeat function, which is set to `false` by default. If set to `true`, the camera node will send heartbeat signals to
|
||||||
the firmware, and if hardware logging is desired, it should also be set to `true`.
|
the firmware, and if hardware logging is desired, it should also be set to `true`.
|
||||||
- `log_level` : SDK log level, the default value is `info`, the optional values are `debug`, `info`, `warn`, `error`, `fatal`.
|
- `log_level` : SDK log level, the default value is `info`, the optional values are `debug`, `info`, `warn`, `error`, `fatal`.
|
||||||
- `enable_color_undistortion`: Enables color undistortion, the default value is `false`. Note that our color cameras exhibit minimal distortion, and typically, undistortion is not necessary.
|
- `enable_color_undistortion`: Enables color undistortion, the default value is `false`. Note that our color cameras exhibit minimal distortion, and typically, undistortion is not necessary.
|
||||||
|
|
||||||
@@ -328,16 +335,51 @@ the firmware, and if hardware logging is desired, it should also be set to `true
|
|||||||
at [this link](https://www.orbbec.com/docs/g330-use-depth-post-processing-blocks/). If you are uncertain, do not modify
|
at [this link](https://www.orbbec.com/docs/g330-use-depth-post-processing-blocks/). If you are uncertain, do not modify
|
||||||
these settings.*
|
these settings.*
|
||||||
|
|
||||||
|
## ROS2(Robot) vs Optical(Camera) Coordination Systems
|
||||||
|
|
||||||
|
* Point Of View:
|
||||||
|
* Imagine we are standing behind of the camera, and looking forward.
|
||||||
|
* Always use this point of view when talking about coordinates, left vs right IRs, position of sensor, etc..
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
* ROS2 Coordinate System: (X: Forward, Y:Left, Z: Up)
|
||||||
|
* Camera Optical Coordinate System: (X: Right, Y: Down, Z: Forward)
|
||||||
|
* All data published in our wrapper topics is optical data taken directly from our camera sensors.
|
||||||
|
* static and dynamic TF topics publish optical CS and ROS CS to give the user the ability to move from one CS to other CS.
|
||||||
|
|
||||||
|
## Camera sensor structure
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## TF from coordinate A to coordinate B:
|
||||||
|
|
||||||
|
In Orbbec cameras, the origin point (0,0,0) is taken from the camera_link position
|
||||||
|
|
||||||
|
Our wrapper provide static TFs between each sensor coordinate to the camera base (camera_link)
|
||||||
|
|
||||||
|
Also, it provides TFs from each sensor ROS coordinates to its corrosponding optical coordinates.
|
||||||
|
|
||||||
|
Example of static TFs of RGB sensor and right infra sensor of Gemini335 module as it shown in rviz2:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ros2 launch orbbec_description view_model.launch.py model:=gemini_335_336.urdf.xacro
|
||||||
|
```
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
## Predefined presets
|
## Predefined presets
|
||||||
|
|
||||||
| Preset | Features | Recommended use cases |
|
| Preset | Features | Recommended use cases |
|
||||||
|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||||
| Default | - Best visual perception<br/>- Overall good performance in accuracy, fill rate, tiny objects, etc. | - Generic<br>- Robotics |
|
| Default | - Best visual perception``- Overall good performance in accuracy, fill rate, tiny objects, etc. | - Generic `<br>`- Robotics |
|
||||||
| Hand | - Clear hand and finger edges | - Gesture recognition |
|
| Hand | - Clear hand and finger edges | - Gesture recognition |
|
||||||
| High Accuracy | - Depth of high confidence<br>- Barely noise depth values<br>- Lower fill rate | - Collision avoidance<br>- Object scanning |
|
| High Accuracy | - Depth of high confidence `<br>`- Barely noise depth values `<br>`- Lower fill rate | - Collision avoidance `<br>`- Object scanning |
|
||||||
| High Density | - Higher fill rate<br>- More tiny objects<br>- May suffer from noise depth values | - Object recognition<br>- Pick & place<br>- Foreground & background animation |
|
| High Density | - Higher fill rate `<br>`- More tiny objects `<br>`- May suffer from noise depth values | - Object recognition `<br>`- Pick & place `<br>`- Foreground & background animation |
|
||||||
| Medium Density | - Balanced performance in fill rate and accuracy<br>- In comparison to Default: lower fill rate, better edge quality | - Generic and alternative to Default |
|
| Medium Density | - Balanced performance in fill rate and accuracy `<br>`- In comparison to Default: lower fill rate, better edge quality | - Generic and alternative to Default |
|
||||||
| Custom | - User defined Preset<br>- Derived from Presets above, with customized modifications, e.g. a new configuration for the post-processing pipeline, modified mean intensity set point of depth AE function, etc. | - Better depth performance achieved using customized configurations in comparison to using predefined presets<br>- For well-established custom configurations |
|
| Custom | - User defined Preset `<br>`- Derived from Presets above, with customized modifications, e.g. a new configuration for the post-processing pipeline, modified mean intensity set point of depth AE function, etc. | - Better depth performance achieved using customized configurations in comparison to using predefined presets `<br>`- For well-established custom configurations |
|
||||||
|
|
||||||
Choose the appropriate preset name based on your specific use case and set it as the value for the `device_preset`
|
Choose the appropriate preset name based on your specific use case and set it as the value for the `device_preset`
|
||||||
parameter.
|
parameter.
|
||||||
@@ -432,7 +474,7 @@ to `true` in the stream that corresponds to the argument of the launch file.
|
|||||||
- `/camera/ir/camera_info`: The IR camera info.
|
- `/camera/ir/camera_info`: The IR camera info.
|
||||||
- `/camera/ir/image_raw`: The IR stream image
|
- `/camera/ir/image_raw`: The IR stream image
|
||||||
- `/camera/accel/sample`: Acceleration data stream `enable_sync_output_accel_gyro`turned off,`enable_accel`turned on
|
- `/camera/accel/sample`: Acceleration data stream `enable_sync_output_accel_gyro`turned off,`enable_accel`turned on
|
||||||
- `/camera/gyro/sample`: Gyroscope data stream,enable_sync_output_accel_gyro`turned off,`enable_gyro`turned on
|
- `/camera/gyro/sample`: Gyroscope data stream,enable_sync_output_accel_gyro `turned off,`enable_gyro`turned on
|
||||||
- `camera/gyro_accel/sample`: Synchronized data stream of acceleration and gyroscope,`enable_sync_output_accel_gyro`
|
- `camera/gyro_accel/sample`: Synchronized data stream of acceleration and gyroscope,`enable_sync_output_accel_gyro`
|
||||||
turned on
|
turned on
|
||||||
- `/diagnostics`: The diagnostic information of the camera, Currently, the diagnostic information only includes the
|
- `/diagnostics`: The diagnostic information of the camera, Currently, the diagnostic information only includes the
|
||||||
@@ -519,9 +561,11 @@ ros2 launch orbbec_camera multi_camera.launch.py
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Compressed Image
|
## Compressed Image
|
||||||
|
|
||||||
You can use `image_transport` to compress the image using `jpeg`. Below is an example of how to use it:
|
You can use `image_transport` to compress the image using `jpeg`. Below is an example of how to use it:
|
||||||
|
|
||||||
To access the compressed color image, you can use the following command:
|
To access the compressed color image, you can use the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ros2 topic echo /camera/color/image_raw/compressed --no-arr
|
ros2 topic echo /camera/color/image_raw/compressed --no-arr
|
||||||
```
|
```
|
||||||
@@ -595,37 +639,18 @@ bash .make_deb.sh
|
|||||||
|
|
||||||
## Launch files
|
## Launch files
|
||||||
|
|
||||||
| product serials | launch file |
|
| product serials | Firmware Version | **Firmware Version** |
|
||||||
|---------------------------------------|-----------------------------|
|
| :-------------: | :--------------: | :-------------------------: |
|
||||||
| astra+ | astra_adv.launch.py |
|
| Astra2 | 2.8.20 | astra2.launch.py |
|
||||||
| astra mini /astra mini pro /astra pro | astra.launch.py |
|
| Femto mega | 1.1.7/1.2.7 | femto_mega.launch.py |
|
||||||
| astra mini pro s | astra.launch.py |
|
| Femto bolt | 1.0.6/1.0.9 | femto_bolt.launch.py |
|
||||||
| astra2 | astra2.launch.py |
|
| Gemini2 | 1.4.60 /1.4.76 | gemini2.launch.py |
|
||||||
| astra stereo s | stereo_s_u3.launch.py |
|
| Gemini2L | 1.4.32 | gemini2L.launch.py |
|
||||||
| astra pro2 | astra_pro2.launch.py |
|
| Gemini 335 | 1.2.20 | gemini_330_series.launch.py |
|
||||||
| dabai | dabai.launch.py |
|
| Gemini 335L | 1.2.20 | gemini_330_series.launch.py |
|
||||||
| dabai d1 | dabai_d1.launch.py |
|
| Gemini 335Lg | 1.3.46 | gemini_330_series.launch.py |
|
||||||
| dabai dcw | dabai_dcw.launch.py |
|
| Gemini 336 | 1.2.20 | gemini_330_series.launch.py |
|
||||||
| dabai dw | dabai_dw.launch.py |
|
| Gemini 336L | 1.2.20 | gemini_330_series.launch.py |
|
||||||
| dabai pro | dabai_pro.launch.py |
|
|
||||||
| deeya | deeya.launch.py |
|
|
||||||
| femto /femto w | femto.launch.py |
|
|
||||||
| femto mega | femto_mega.launch.py |
|
|
||||||
| femto bolt | femto_bolt.launch.py |
|
|
||||||
| gemini | gemini.launch.py |
|
|
||||||
| gemini | gemini.launch.py |
|
|
||||||
| gemini2 / dabai DCL | gemini2.launch.py |
|
|
||||||
| gemini2L | gemini2L.launch.py |
|
|
||||||
| gemini e | gemini_e.launch.py |
|
|
||||||
| gemini e lite | gemini_e_lite.launch.py |
|
|
||||||
| dabai max | dabai_max.launch.py |
|
|
||||||
| dabai max pro | dabai_max_pro.launch.py |
|
|
||||||
| gemini uw | gemini_uw.launch.py |
|
|
||||||
| dabai dcw2 | dabai_dcw2.launch.py |
|
|
||||||
| dabai dw2 | dabai_dw2.launch.py |
|
|
||||||
| gemini ew | gemini_ew.launch.py |
|
|
||||||
| gemini ew lite | gemini_ew_lite.launch.py |
|
|
||||||
| gemini 330 series | gemini_330_series.launch.py |
|
|
||||||
|
|
||||||
**All launch files are essentially similar, with the primary difference being the default values of the parameters set
|
**All launch files are essentially similar, with the primary difference being the default values of the parameters set
|
||||||
for different models
|
for different models
|
||||||
@@ -703,7 +728,6 @@ net.core.rmem_default=2147483647
|
|||||||
|
|
||||||
If you use Fast DDS, you can refer to the [Fast DDS Configuration](./docs/fastdds_tuning.md) file.
|
If you use Fast DDS, you can refer to the [Fast DDS Configuration](./docs/fastdds_tuning.md) file.
|
||||||
|
|
||||||
|
|
||||||
## Frequently Asked Questions
|
## Frequently Asked Questions
|
||||||
|
|
||||||
### Unexpected Crash
|
### Unexpected Crash
|
||||||
@@ -714,24 +738,29 @@ Please send this log to the support team or submit it to a GitHub issue for furt
|
|||||||
### No Data Stream from Multiple Cameras
|
### No Data Stream from Multiple Cameras
|
||||||
|
|
||||||
**Insufficient Power Supply**:
|
**Insufficient Power Supply**:
|
||||||
|
|
||||||
- Ensure that each camera is connected to a separate hub.
|
- Ensure that each camera is connected to a separate hub.
|
||||||
- Use a powered hub to provide sufficient power to each camera.
|
- Use a powered hub to provide sufficient power to each camera.
|
||||||
|
|
||||||
**High Resolution**:
|
**High Resolution**:
|
||||||
|
|
||||||
- Try lowering the resolution to resolve data stream issues.
|
- Try lowering the resolution to resolve data stream issues.
|
||||||
|
|
||||||
**Increase usbfs_memory_mb Value**:
|
**Increase usbfs_memory_mb Value**:
|
||||||
|
|
||||||
- Increase the `usbfs_memory_mb` value to 128MB (this is a reference value and can be adjusted based on your system’s needs)
|
- Increase the `usbfs_memory_mb` value to 128MB (this is a reference value and can be adjusted based on your system’s needs)
|
||||||
by running the following command:
|
by running the following command:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo 128 | sudo tee /sys/module/usbcore/parameters/usbfs_memory_mb
|
echo 128 | sudo tee /sys/module/usbcore/parameters/usbfs_memory_mb
|
||||||
```
|
```
|
||||||
|
|
||||||
- To make this change permanent, check [this link](https://github.com/OpenKinect/libfreenect2/issues/807).
|
- To make this change permanent, check [this link](https://github.com/OpenKinect/libfreenect2/issues/807).
|
||||||
|
|
||||||
### Additional Troubleshooting
|
### Additional Troubleshooting
|
||||||
|
|
||||||
- If you encounter other issues, set the `log_level` parameter to `debug`. This will generate an SDK log file in the running directory: `Log/OrbbecSDK.log.txt`.
|
- If you encounter other issues, set the `log_level` parameter to `debug`. This will generate an SDK log file in the running directory: `Log/OrbbecSDK.log.txt`.
|
||||||
Please provide this file to the support team for further assistance.
|
Please provide this file to the support team for further assistance.
|
||||||
- If firmware logs are required, set `enable_heartbeat` to `true` to activate this feature.
|
- If firmware logs are required, set `enable_heartbeat` to `true` to activate this feature.
|
||||||
|
|
||||||
### Why Are There So Many Launch Files?
|
### Why Are There So Many Launch Files?
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 256 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 126 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 270 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 154 KiB |
@@ -632,7 +632,7 @@ OB_EXPORT void ob_delete_camera_param_list(ob_camera_param_list *param_list, ob_
|
|||||||
#define ob_device_info_uid ob_device_info_get_uid
|
#define ob_device_info_uid ob_device_info_get_uid
|
||||||
#define ob_device_info_serial_number ob_device_info_get_serial_number
|
#define ob_device_info_serial_number ob_device_info_get_serial_number
|
||||||
#define ob_device_info_firmware_version ob_device_info_get_firmware_version
|
#define ob_device_info_firmware_version ob_device_info_get_firmware_version
|
||||||
#define ob_device_info_connection_type ob_device_list_get_device_connection_type
|
#define ob_device_info_connection_type ob_device_info_get_connection_type
|
||||||
#define ob_device_info_ip_address ob_device_info_get_ip_address
|
#define ob_device_info_ip_address ob_device_info_get_ip_address
|
||||||
#define ob_device_info_hardware_version ob_device_info_get_hardware_version
|
#define ob_device_info_hardware_version ob_device_info_get_hardware_version
|
||||||
#define ob_device_info_supported_min_sdk_version ob_device_info_get_supported_min_sdk_version
|
#define ob_device_info_supported_min_sdk_version ob_device_info_get_supported_min_sdk_version
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public:
|
|||||||
* @brief Creates a network device with the specified IP address and port.
|
* @brief Creates a network device with the specified IP address and port.
|
||||||
*
|
*
|
||||||
* @param[in] address The IP address, ipv4 only. such as "192.168.1.10"
|
* @param[in] address The IP address, ipv4 only. such as "192.168.1.10"
|
||||||
* @param[in] port The port number.
|
* @param[in] port The port number, currently only support 8090
|
||||||
* @return std::shared_ptr<Device> The created device object.
|
* @return std::shared_ptr<Device> The created device object.
|
||||||
*/
|
*/
|
||||||
std::shared_ptr<Device> createNetDevice(const char *address, uint16_t port) const {
|
std::shared_ptr<Device> createNetDevice(const char *address, uint16_t port) const {
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ public:
|
|||||||
ob_error *error = nullptr;
|
ob_error *error = nullptr;
|
||||||
auto profile = ob_frame_get_stream_profile(impl_, &error);
|
auto profile = ob_frame_get_stream_profile(impl_, &error);
|
||||||
Error::handle(&error);
|
Error::handle(&error);
|
||||||
return std::make_shared<StreamProfile>(profile);
|
return StreamProfileFactory::create(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
#include "Types.hpp"
|
#include "Types.hpp"
|
||||||
#include "libobsensor/h/StreamProfile.h"
|
#include "libobsensor/h/StreamProfile.h"
|
||||||
|
#include "libobsensor/h/Error.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@@ -19,9 +20,7 @@ protected:
|
|||||||
const ob_stream_profile_t *impl_ = nullptr;
|
const ob_stream_profile_t *impl_ = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit StreamProfile(const ob_stream_profile_t *impl) : impl_(impl) {}
|
StreamProfile(StreamProfile &streamProfile) = delete;
|
||||||
|
|
||||||
StreamProfile(StreamProfile &streamProfile) = delete;
|
|
||||||
StreamProfile &operator=(StreamProfile &streamProfile) = delete;
|
StreamProfile &operator=(StreamProfile &streamProfile) = delete;
|
||||||
|
|
||||||
StreamProfile(StreamProfile &&streamProfile) noexcept : impl_(streamProfile.impl_) {
|
StreamProfile(StreamProfile &&streamProfile) noexcept : impl_(streamProfile.impl_) {
|
||||||
@@ -106,7 +105,7 @@ public:
|
|||||||
throw std::runtime_error("Unsupported operation. Object's type is not the required type.");
|
throw std::runtime_error("Unsupported operation. Object's type is not the required type.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::static_pointer_cast<T>(shared_from_this());
|
return std::dynamic_pointer_cast<T>(shared_from_this());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -123,7 +122,6 @@ public:
|
|||||||
return std::static_pointer_cast<const T>(shared_from_this());
|
return std::static_pointer_cast<const T>(shared_from_this());
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
|
||||||
// The following interfaces are deprecated and are retained here for compatibility purposes.
|
// The following interfaces are deprecated and are retained here for compatibility purposes.
|
||||||
OBFormat format() const {
|
OBFormat format() const {
|
||||||
return getFormat();
|
return getFormat();
|
||||||
@@ -132,6 +130,9 @@ public:
|
|||||||
OBStreamType type() const {
|
OBStreamType type() const {
|
||||||
return getType();
|
return getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
explicit StreamProfile(const ob_stream_profile_t *impl) : impl_(impl) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -351,6 +352,33 @@ template <typename T> bool StreamProfile::is() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class StreamProfileFactory {
|
||||||
|
public:
|
||||||
|
static std::shared_ptr<StreamProfile> create(const ob_stream_profile_t *impl) {
|
||||||
|
ob_error *error = nullptr;
|
||||||
|
const auto type = ob_stream_profile_get_type(impl, &error);
|
||||||
|
Error::handle(&error);
|
||||||
|
switch(type) {
|
||||||
|
case OB_STREAM_IR:
|
||||||
|
case OB_STREAM_IR_LEFT:
|
||||||
|
case OB_STREAM_IR_RIGHT:
|
||||||
|
case OB_STREAM_DEPTH:
|
||||||
|
case OB_STREAM_COLOR:
|
||||||
|
case OB_STREAM_VIDEO:
|
||||||
|
return std::make_shared<VideoStreamProfile>(impl);
|
||||||
|
case OB_STREAM_ACCEL:
|
||||||
|
return std::make_shared<AccelStreamProfile>(impl);
|
||||||
|
case OB_STREAM_GYRO:
|
||||||
|
return std::make_shared<GyroStreamProfile>(impl);
|
||||||
|
default: {
|
||||||
|
ob_error *err = ob_create_error(OB_STATUS_ERROR, "Unsupported stream type.", "StreamProfileFactory::create", "", OB_EXCEPTION_TYPE_INVALID_VALUE);
|
||||||
|
Error::handle(&err);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class StreamProfileList {
|
class StreamProfileList {
|
||||||
protected:
|
protected:
|
||||||
const ob_stream_profile_list_t *impl_;
|
const ob_stream_profile_list_t *impl_;
|
||||||
@@ -385,7 +413,7 @@ public:
|
|||||||
ob_error *error = nullptr;
|
ob_error *error = nullptr;
|
||||||
auto profile = ob_stream_profile_list_get_profile(impl_, index, &error);
|
auto profile = ob_stream_profile_list_get_profile(impl_, index, &error);
|
||||||
Error::handle(&error);
|
Error::handle(&error);
|
||||||
return std::make_shared<StreamProfile>(profile);
|
return StreamProfileFactory::create(profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -403,7 +431,8 @@ public:
|
|||||||
ob_error *error = nullptr;
|
ob_error *error = nullptr;
|
||||||
auto profile = ob_stream_profile_list_get_video_stream_profile(impl_, width, height, format, fps, &error);
|
auto profile = ob_stream_profile_list_get_video_stream_profile(impl_, width, height, format, fps, &error);
|
||||||
Error::handle(&error);
|
Error::handle(&error);
|
||||||
return std::make_shared<VideoStreamProfile>(profile);
|
auto vsp = StreamProfileFactory::create(profile);
|
||||||
|
return vsp->as<VideoStreamProfile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -417,7 +446,8 @@ public:
|
|||||||
ob_error *error = nullptr;
|
ob_error *error = nullptr;
|
||||||
auto profile = ob_stream_profile_list_get_accel_stream_profile(impl_, fullScaleRange, sampleRate, &error);
|
auto profile = ob_stream_profile_list_get_accel_stream_profile(impl_, fullScaleRange, sampleRate, &error);
|
||||||
Error::handle(&error);
|
Error::handle(&error);
|
||||||
return std::make_shared<AccelStreamProfile>(profile);
|
auto asp = StreamProfileFactory::create(profile);
|
||||||
|
return asp->as<AccelStreamProfile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -431,7 +461,8 @@ public:
|
|||||||
ob_error *error = nullptr;
|
ob_error *error = nullptr;
|
||||||
auto profile = ob_stream_profile_list_get_gyro_stream_profile(impl_, fullScaleRange, sampleRate, &error);
|
auto profile = ob_stream_profile_list_get_gyro_stream_profile(impl_, fullScaleRange, sampleRate, &error);
|
||||||
Error::handle(&error);
|
Error::handle(&error);
|
||||||
return std::make_shared<GyroStreamProfile>(profile);
|
auto gsp = StreamProfileFactory::create(profile);
|
||||||
|
return gsp->as<GyroStreamProfile>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -442,4 +473,3 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ob
|
} // namespace ob
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,33 +1,33 @@
|
|||||||
# common params
|
# common params
|
||||||
depth_registration: false
|
depth_registration: true
|
||||||
enable_point_cloud: false
|
enable_point_cloud: false
|
||||||
enable_colored_point_cloud: false
|
enable_colored_point_cloud: false
|
||||||
device_preset: "High Accuracy"
|
device_preset: "High Accuracy"
|
||||||
laser_on_off_mode: 1 # 0: off, 1: on-off, 1: off-on
|
laser_on_off_mode: 0 # 0: off, 1: on-off, 1: off-on
|
||||||
time_domain: "global" # global, device, system
|
time_domain: "global" # global, device, system
|
||||||
enable_sync_host_time: false
|
enable_sync_host_time: false
|
||||||
frames_per_trigger: 2
|
frames_per_trigger: 1
|
||||||
|
|
||||||
# When 3D reconstruction mode is enabled:
|
# When 3D reconstruction mode is enabled:
|
||||||
# - The laser will switch to on-off mode
|
# - The laser will switch to on-off mode
|
||||||
# - IR images without the laser will be used for SLAM localization
|
# - IR images without the laser will be used for SLAM localization
|
||||||
# - Depth images with the laser will be used because they provide better depth quality
|
# - Depth images with the laser will be used because they provide better depth quality
|
||||||
enable_3d_reconstruction_mode: true
|
enable_3d_reconstruction_mode: false
|
||||||
|
|
||||||
# color params
|
# color params
|
||||||
enable_color: true
|
enable_color: true
|
||||||
color_width: 640
|
color_width: 640
|
||||||
color_height: 480
|
color_height: 480
|
||||||
color_fps: 90
|
color_fps: 30
|
||||||
color_format: "YUYV"
|
color_format: "YUYV"
|
||||||
enable_color_auto_exposure: false
|
enable_color_auto_exposure: true
|
||||||
color_exposure: 50 # 5ms
|
color_exposure: 50 # 5ms
|
||||||
color_gain: -1 # -1 default
|
color_gain: -1 # -1 default
|
||||||
|
|
||||||
# depth params
|
# depth params
|
||||||
depth_width: 640
|
depth_width: 640
|
||||||
depth_height: 480
|
depth_height: 480
|
||||||
depth_fps: 90
|
depth_fps: 30
|
||||||
depth_format: "Y16"
|
depth_format: "Y16"
|
||||||
|
|
||||||
# ir exposure
|
# ir exposure
|
||||||
@@ -39,12 +39,12 @@ ir_gain: 40
|
|||||||
enable_left_ir: true
|
enable_left_ir: true
|
||||||
left_ir_width: 640
|
left_ir_width: 640
|
||||||
left_ir_height: 480
|
left_ir_height: 480
|
||||||
left_ir_fps: 90
|
left_ir_fps: 30
|
||||||
left_ir_format: "Y8"
|
left_ir_format: "Y8"
|
||||||
|
|
||||||
#right ir params
|
#right ir params
|
||||||
enable_right_ir: true
|
enable_right_ir: true
|
||||||
right_ir_width: 640
|
right_ir_width: 640
|
||||||
right_ir_height: 480
|
right_ir_height: 480
|
||||||
right_ir_fps: 90
|
right_ir_fps: 30
|
||||||
right_ir_format: "Y8"
|
right_ir_format: "Y8"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#define OB_ROS_MAJOR_VERSION 2
|
#define OB_ROS_MAJOR_VERSION 2
|
||||||
#define OB_ROS_MINOR_VERSION 0
|
#define OB_ROS_MINOR_VERSION 0
|
||||||
#define OB_ROS_PATCH_VERSION 5
|
#define OB_ROS_PATCH_VERSION 7
|
||||||
|
|
||||||
#ifndef STRINGIFY
|
#ifndef STRINGIFY
|
||||||
#define STRINGIFY(arg) #arg
|
#define STRINGIFY(arg) #arg
|
||||||
|
|||||||
@@ -63,6 +63,7 @@
|
|||||||
#include "orbbec_camera/image_publisher.h"
|
#include "orbbec_camera/image_publisher.h"
|
||||||
#include "jpeg_decoder.h"
|
#include "jpeg_decoder.h"
|
||||||
#include <std_msgs/msg/string.hpp>
|
#include <std_msgs/msg/string.hpp>
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
#if defined(ROS_JAZZY) || defined(ROS_IRON)
|
#if defined(ROS_JAZZY) || defined(ROS_IRON)
|
||||||
#include <cv_bridge/cv_bridge.hpp>
|
#include <cv_bridge/cv_bridge.hpp>
|
||||||
@@ -94,6 +95,8 @@
|
|||||||
(static_cast<std::ostringstream&&>(std::ostringstream() << getNamespaceStr() << "_odom_frame")) \
|
(static_cast<std::ostringstream&&>(std::ostringstream() << getNamespaceStr() << "_odom_frame")) \
|
||||||
.str()
|
.str()
|
||||||
|
|
||||||
|
#define DEVICE_PATH "/dev/camsync"
|
||||||
|
|
||||||
namespace orbbec_camera {
|
namespace orbbec_camera {
|
||||||
using GetDeviceInfo = orbbec_camera_msgs::srv::GetDeviceInfo;
|
using GetDeviceInfo = orbbec_camera_msgs::srv::GetDeviceInfo;
|
||||||
using Extrinsics = orbbec_camera_msgs::msg::Extrinsics;
|
using Extrinsics = orbbec_camera_msgs::msg::Extrinsics;
|
||||||
@@ -129,6 +132,11 @@ const std::map<OBStreamType, OBFrameType> STREAM_TYPE_TO_FRAME_TYPE = {
|
|||||||
{OB_STREAM_ACCEL, OB_FRAME_ACCEL},
|
{OB_STREAM_ACCEL, OB_FRAME_ACCEL},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
uint8_t mode;
|
||||||
|
uint16_t fps;
|
||||||
|
} cs_param_t;
|
||||||
|
|
||||||
class OBCameraNode {
|
class OBCameraNode {
|
||||||
public:
|
public:
|
||||||
OBCameraNode(rclcpp::Node* node, std::shared_ptr<ob::Device> device,
|
OBCameraNode(rclcpp::Node* node, std::shared_ptr<ob::Device> device,
|
||||||
@@ -152,6 +160,11 @@ class OBCameraNode {
|
|||||||
|
|
||||||
void startIMU();
|
void startIMU();
|
||||||
|
|
||||||
|
int openSocSyncPwmTrigger(uint16_t fps);
|
||||||
|
int closeSocSyncPwmTrigger();
|
||||||
|
void startGmslTrigger();
|
||||||
|
void stopGmslTrigger();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct IMUData {
|
struct IMUData {
|
||||||
IMUData() = default;
|
IMUData() = default;
|
||||||
@@ -539,6 +552,9 @@ class OBCameraNode {
|
|||||||
int hdr_merge_gain_1_ = -1;
|
int hdr_merge_gain_1_ = -1;
|
||||||
int hdr_merge_exposure_2_ = -1;
|
int hdr_merge_exposure_2_ = -1;
|
||||||
int hdr_merge_gain_2_ = -1;
|
int hdr_merge_gain_2_ = -1;
|
||||||
|
int gmsl_trigger_fd_ = -1;
|
||||||
|
int gmsl_trigger_fps_ = -1;
|
||||||
|
bool enable_gmsl_trigger_ = false;
|
||||||
|
|
||||||
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr filter_status_pub_;
|
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr filter_status_pub_;
|
||||||
nlohmann::json filter_status_;
|
nlohmann::json filter_status_;
|
||||||
|
|||||||
@@ -1,126 +0,0 @@
|
|||||||
import os
|
|
||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='RGB'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='RGB'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y16'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='RGB'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='true'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='UYVY'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='360'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='15'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='15'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y14'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='15'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y8'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
|
||||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
|
||||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
|
||||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
|
||||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
|
||||||
DeclareLaunchArgument('gyro_range', default_value='500dps'),
|
|
||||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
|
||||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
# Configure the path for depth filter file, for example: /config/depthfilter/Gemini2_v1.7.json
|
|
||||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
|
||||||
# Depth work mode support is as follows:
|
|
||||||
# Unbinned Dense Default
|
|
||||||
# Unbinned Sparse Default
|
|
||||||
# Binned Sparse Default
|
|
||||||
# Obstacle Avoidance
|
|
||||||
DeclareLaunchArgument('depth_work_mode', default_value=''),
|
|
||||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
|
||||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='360'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='360'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
# /config/depthfilter/Openni_device.json,need config path.
|
|
||||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='320'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y12'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
# /config/depthfilter/Openni_device.json,need config path.
|
|
||||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,127 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='25'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y12'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
# /config/depthfilter/Openni_device.json,need config path.
|
|
||||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_ir_long_exposure', default_value='false'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,124 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='RGB'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='1280'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='800'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('left_ir_width', default_value='1280'),
|
|
||||||
DeclareLaunchArgument('left_ir_height', default_value='800'),
|
|
||||||
DeclareLaunchArgument('left_ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('left_ir_format', default_value='Y8'),
|
|
||||||
DeclareLaunchArgument('enable_left_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_left_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('left_ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('left_ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('right_ir_width', default_value='1280'),
|
|
||||||
DeclareLaunchArgument('right_ir_height', default_value='800'),
|
|
||||||
DeclareLaunchArgument('right_ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('right_ir_format', default_value='Y8'),
|
|
||||||
DeclareLaunchArgument('enable_right_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_right_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('right_ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('right_ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_accel', default_value='true'),
|
|
||||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
|
||||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
|
||||||
DeclareLaunchArgument('enable_gyro', default_value='true'),
|
|
||||||
DeclareLaunchArgument('gyro_rate', default_value='1KHZ'),
|
|
||||||
DeclareLaunchArgument('gyro_range', default_value='500dps'),
|
|
||||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
|
||||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
|
||||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('retry_on_usb3_detection_failure', default_value='false'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,157 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('left_ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('left_ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('left_ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('left_ir_format', default_value='Y8'),
|
|
||||||
DeclareLaunchArgument('enable_left_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_left_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('left_ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('left_ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('right_ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('right_ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('right_ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('right_ir_format', default_value='Y8'),
|
|
||||||
DeclareLaunchArgument('enable_right_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_right_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('right_ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('right_ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
|
||||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
|
||||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
|
||||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
|
||||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
|
||||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
|
||||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
|
||||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('enumerate_net_device', default_value='false'),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
# Depth work mode support is as follows:
|
|
||||||
# Unbinned Dense Default
|
|
||||||
# Unbinned Sparse Default
|
|
||||||
# Binned Sparse Default
|
|
||||||
# Dimensioning
|
|
||||||
DeclareLaunchArgument('depth_work_mode', default_value=''),
|
|
||||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
|
||||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
|
||||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('retry_on_usb3_detection_failure', default_value='false'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -173,6 +173,8 @@ def generate_launch_description():
|
|||||||
DeclareLaunchArgument('enable_color_undistortion', default_value='false'),
|
DeclareLaunchArgument('enable_color_undistortion', default_value='false'),
|
||||||
DeclareLaunchArgument('config_file_path', default_value=''),
|
DeclareLaunchArgument('config_file_path', default_value=''),
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||||
|
DeclareLaunchArgument('gmsl_trigger_fps', default_value='3000'),
|
||||||
|
DeclareLaunchArgument('enable_gmsl_trigger', default_value='false'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_params(context, args):
|
def get_params(context, args):
|
||||||
|
|||||||
@@ -1,125 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='360'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='360'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,110 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='360'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
# /config/depthfilter/Openni_device.json,need config path.
|
|
||||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
# /config/depthfilter/Openni_device.json,need config path.
|
|
||||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -172,6 +172,8 @@ def generate_launch_description():
|
|||||||
DeclareLaunchArgument('topic_type', default_value='points'),
|
DeclareLaunchArgument('topic_type', default_value='points'),
|
||||||
DeclareLaunchArgument('topic_name', default_value='/camera/depth_registered/points'),
|
DeclareLaunchArgument('topic_name', default_value='/camera/depth_registered/points'),
|
||||||
DeclareLaunchArgument('use_intra_process_comms', default_value='true'),
|
DeclareLaunchArgument('use_intra_process_comms', default_value='true'),
|
||||||
|
DeclareLaunchArgument('gmsl_trigger_fps', default_value='3000'),
|
||||||
|
DeclareLaunchArgument('enable_gmsl_trigger', default_value='false'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_params(context, args):
|
def get_params(context, args):
|
||||||
|
|||||||
@@ -1,127 +0,0 @@
|
|||||||
from launch import LaunchDescription
|
|
||||||
from launch.actions import DeclareLaunchArgument
|
|
||||||
from launch.substitutions import LaunchConfiguration
|
|
||||||
from launch_ros.actions import PushRosNamespace
|
|
||||||
from launch.actions import GroupAction
|
|
||||||
from launch_ros.actions import ComposableNodeContainer
|
|
||||||
from launch_ros.descriptions import ComposableNode
|
|
||||||
from launch_ros.actions import Node
|
|
||||||
import os
|
|
||||||
|
|
||||||
|
|
||||||
def generate_launch_description():
|
|
||||||
# Declare arguments
|
|
||||||
args = [
|
|
||||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
|
||||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
|
||||||
DeclareLaunchArgument('serial_number', default_value=''),
|
|
||||||
DeclareLaunchArgument('usb_port', default_value=''),
|
|
||||||
DeclareLaunchArgument('device_num', default_value='1'),
|
|
||||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
|
||||||
DeclareLaunchArgument('product_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
|
||||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
|
||||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
|
||||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
|
||||||
DeclareLaunchArgument('color_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('color_height', default_value='480'),
|
|
||||||
DeclareLaunchArgument('color_fps', default_value='25'),
|
|
||||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
|
||||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
|
||||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
|
||||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('depth_format', default_value='Y12'),
|
|
||||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
|
||||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
|
||||||
# /config/depthfilter/Openni_device.json,need config path.
|
|
||||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
|
||||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
|
||||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
|
||||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
|
||||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
|
||||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
|
||||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
|
||||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
|
||||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
|
||||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_ir_long_exposure', default_value='false'),
|
|
||||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
|
||||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
|
||||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
|
||||||
DeclareLaunchArgument('log_level', default_value='none'),
|
|
||||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
|
||||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
|
||||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
|
||||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
|
||||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
|
||||||
]
|
|
||||||
|
|
||||||
# Node configuration
|
|
||||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
|
||||||
# get ROS_DISTRO
|
|
||||||
ros_distro = os.environ["ROS_DISTRO"]
|
|
||||||
if ros_distro == "foxy":
|
|
||||||
return LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
Node(
|
|
||||||
package="orbbec_camera",
|
|
||||||
executable="orbbec_camera_node",
|
|
||||||
name="ob_camera_node",
|
|
||||||
namespace=LaunchConfiguration("camera_name"),
|
|
||||||
parameters=parameters,
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# Define the ComposableNode
|
|
||||||
else:
|
|
||||||
# Define the ComposableNode
|
|
||||||
compose_node = ComposableNode(
|
|
||||||
package="orbbec_camera",
|
|
||||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
|
||||||
name=LaunchConfiguration("camera_name"),
|
|
||||||
namespace="",
|
|
||||||
parameters=parameters,
|
|
||||||
)
|
|
||||||
# Define the ComposableNodeContainer
|
|
||||||
container = ComposableNodeContainer(
|
|
||||||
name="camera_container",
|
|
||||||
namespace="",
|
|
||||||
package="rclcpp_components",
|
|
||||||
executable="component_container",
|
|
||||||
composable_node_descriptions=[
|
|
||||||
compose_node,
|
|
||||||
],
|
|
||||||
output="screen",
|
|
||||||
)
|
|
||||||
# Launch description
|
|
||||||
ld = LaunchDescription(
|
|
||||||
args
|
|
||||||
+ [
|
|
||||||
GroupAction(
|
|
||||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
return ld
|
|
||||||
@@ -16,21 +16,39 @@ def generate_launch_description():
|
|||||||
),
|
),
|
||||||
launch_arguments={
|
launch_arguments={
|
||||||
'camera_name': 'camera_01',
|
'camera_name': 'camera_01',
|
||||||
'usb_port': 'gmsl2-2',
|
'usb_port': 'gmsl2-1',
|
||||||
'device_num': '2',
|
'device_num': '2',
|
||||||
'sync_mode': 'standalone'
|
'sync_mode': 'standalone',
|
||||||
|
'enable_left_ir': 'true',
|
||||||
|
'enable_right_ir': 'true',
|
||||||
}.items()
|
}.items()
|
||||||
)
|
)
|
||||||
|
|
||||||
launch2_include = IncludeLaunchDescription(
|
# launch2_include = IncludeLaunchDescription(
|
||||||
|
# PythonLaunchDescriptionSource(
|
||||||
|
# os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||||
|
# ),
|
||||||
|
# launch_arguments={
|
||||||
|
# 'camera_name': 'camera_02',
|
||||||
|
# 'usb_port': 'gmsl2-2',
|
||||||
|
# 'device_num': '3',
|
||||||
|
# 'sync_mode': 'standalone',
|
||||||
|
# 'enable_left_ir': 'false',
|
||||||
|
# 'enable_right_ir': 'false',
|
||||||
|
# }.items()
|
||||||
|
# )
|
||||||
|
|
||||||
|
launch3_include = IncludeLaunchDescription(
|
||||||
PythonLaunchDescriptionSource(
|
PythonLaunchDescriptionSource(
|
||||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||||
),
|
),
|
||||||
launch_arguments={
|
launch_arguments={
|
||||||
'camera_name': 'camera_02',
|
'camera_name': 'camera_03',
|
||||||
'usb_port': 'gmsl2-3',
|
'usb_port': 'gmsl2-3',
|
||||||
'device_num': '2',
|
'device_num': '2',
|
||||||
'sync_mode': 'standalone'
|
'sync_mode': 'standalone',
|
||||||
|
'enable_left_ir': 'true',
|
||||||
|
'enable_right_ir': 'true',
|
||||||
}.items()
|
}.items()
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -39,7 +57,8 @@ def generate_launch_description():
|
|||||||
# Launch description
|
# Launch description
|
||||||
ld = LaunchDescription([
|
ld = LaunchDescription([
|
||||||
GroupAction([launch1_include]),
|
GroupAction([launch1_include]),
|
||||||
GroupAction([launch2_include]),
|
# GroupAction([launch2_include]),
|
||||||
|
GroupAction([launch3_include]),
|
||||||
])
|
])
|
||||||
|
|
||||||
return ld
|
return ld
|
||||||
|
|||||||
@@ -18,58 +18,62 @@ def generate_launch_description():
|
|||||||
),
|
),
|
||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "front_camera",
|
"camera_name": "front_camera",
|
||||||
"usb_port": "2-6",
|
"usb_port": "gmsl2-1",
|
||||||
"device_num": "3",
|
"device_num": "2",
|
||||||
"sync_mode": "software_triggering",
|
"sync_mode": "hardware_triggering",
|
||||||
"config_file_path": config_file_path,
|
"config_file_path": config_file_path,
|
||||||
|
"enable_gmsl_trigger": "true",
|
||||||
}.items(),
|
}.items(),
|
||||||
)
|
)
|
||||||
|
|
||||||
left_camera = IncludeLaunchDescription(
|
# left_camera = IncludeLaunchDescription(
|
||||||
PythonLaunchDescriptionSource(
|
# PythonLaunchDescriptionSource(
|
||||||
os.path.join(launch_file_dir, "gemini_330_series.launch.py")
|
# os.path.join(launch_file_dir, "gemini_330_series.launch.py")
|
||||||
),
|
# ),
|
||||||
launch_arguments={
|
# launch_arguments={
|
||||||
"camera_name": "left_camera",
|
# "camera_name": "left_camera",
|
||||||
"usb_port": "2-1.2.1",
|
# "usb_port": "gmsl2-2",
|
||||||
"device_num": "3",
|
# "device_num": "3",
|
||||||
"sync_mode": "hardware_triggering",
|
# "sync_mode": "secondary",
|
||||||
"config_file_path": config_file_path,
|
# "config_file_path": config_file_path,
|
||||||
}.items(),
|
# "enable_gmsl_trigger": "false",
|
||||||
)
|
# }.items(),
|
||||||
rear_camera = IncludeLaunchDescription(
|
# )
|
||||||
PythonLaunchDescriptionSource(
|
|
||||||
os.path.join(launch_file_dir, "gemini_330_series.launch.py")
|
|
||||||
),
|
|
||||||
launch_arguments={
|
|
||||||
"camera_name": "rear_camera",
|
|
||||||
"usb_port": "2-3",
|
|
||||||
"device_num": "3",
|
|
||||||
"sync_mode": "hardware_triggering",
|
|
||||||
"config_file_path": config_file_path,
|
|
||||||
}.items(),
|
|
||||||
)
|
|
||||||
right_camera = IncludeLaunchDescription(
|
right_camera = IncludeLaunchDescription(
|
||||||
PythonLaunchDescriptionSource(
|
PythonLaunchDescriptionSource(
|
||||||
os.path.join(launch_file_dir, "gemini_330_series.launch.py")
|
os.path.join(launch_file_dir, "gemini_330_series.launch.py")
|
||||||
),
|
),
|
||||||
launch_arguments={
|
launch_arguments={
|
||||||
"camera_name": "right_camera",
|
"camera_name": "right_camera",
|
||||||
"usb_port": "2-7",
|
"usb_port": "gmsl2-3",
|
||||||
"device_num": "3",
|
"device_num": "2",
|
||||||
"sync_mode": "hardware_triggering",
|
"sync_mode": "hardware_triggering",
|
||||||
"config_file_path": config_file_path,
|
"config_file_path": config_file_path,
|
||||||
|
"enable_gmsl_trigger": "false",
|
||||||
}.items(),
|
}.items(),
|
||||||
)
|
)
|
||||||
|
# rear_camera = IncludeLaunchDescription(
|
||||||
|
# PythonLaunchDescriptionSource(
|
||||||
|
# os.path.join(launch_file_dir, "gemini_330_series.launch.py")
|
||||||
|
# ),
|
||||||
|
# launch_arguments={
|
||||||
|
# "camera_name": "rear_camera",
|
||||||
|
# "usb_port": "gmsl2-4",
|
||||||
|
# "device_num": "3",
|
||||||
|
# "sync_mode": "secondary",
|
||||||
|
# "config_file_path": config_file_path,
|
||||||
|
# "enable_gmsl_trigger": "false",
|
||||||
|
# }.items(),
|
||||||
|
# )
|
||||||
|
|
||||||
# Launch description
|
# Launch description
|
||||||
ld = LaunchDescription(
|
ld = LaunchDescription(
|
||||||
[
|
[
|
||||||
GroupAction([rear_camera]),
|
# TimerAction(period=0.5, actions=[GroupAction([rear_camera])]),
|
||||||
GroupAction([left_camera]),
|
TimerAction(period=0.5, actions=[GroupAction([right_camera])]),
|
||||||
GroupAction([right_camera]),
|
# TimerAction(period=0.5, actions=[GroupAction([left_camera])]),
|
||||||
TimerAction(period=3.0, actions=[GroupAction([front_camera])]),
|
TimerAction(period=0.5, actions=[GroupAction([front_camera])]),
|
||||||
# The primary camera should be launched at last
|
# The primary camera should be launched at last
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||||
<package format="3">
|
<package format="3">
|
||||||
<name>orbbec_camera</name>
|
<name>orbbec_camera</name>
|
||||||
<version>2.0.5</version>
|
<version>2.0.7</version>
|
||||||
<description>Orbbec Camera package</description>
|
<description>Orbbec Camera package</description>
|
||||||
<maintainer email="[email protected]">Joe Dong</maintainer>
|
<maintainer email="[email protected]">Joe Dong</maintainer>
|
||||||
<license>Apache-2.0</license>
|
<license>Apache-2.0</license>
|
||||||
|
|||||||
@@ -472,7 +472,7 @@ void OBCameraNode::setupDepthPostProcessFilter() {
|
|||||||
// set depth sensor to filter
|
// set depth sensor to filter
|
||||||
filter_list_ = depth_sensor->getRecommendedFilters();
|
filter_list_ = depth_sensor->getRecommendedFilters();
|
||||||
if (!filter_list_.empty()) {
|
if (!filter_list_.empty()) {
|
||||||
RCLCPP_ERROR(logger_, "Failed to get depth sensor filter list");
|
// RCLCPP_ERROR(logger_, "Failed to get depth sensor filter list");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (size_t i = 0; i < filter_list_.size(); i++) {
|
for (size_t i = 0; i < filter_list_.size(); i++) {
|
||||||
@@ -552,14 +552,14 @@ void OBCameraNode::setupDepthPostProcessFilter() {
|
|||||||
} else if (filter_name == "NoiseRemovalFilter" && enable_noise_removal_filter_) {
|
} else if (filter_name == "NoiseRemovalFilter" && enable_noise_removal_filter_) {
|
||||||
auto noise_removal_filter = filter->as<ob::NoiseRemovalFilter>();
|
auto noise_removal_filter = filter->as<ob::NoiseRemovalFilter>();
|
||||||
OBNoiseRemovalFilterParams params = noise_removal_filter->getFilterParams();
|
OBNoiseRemovalFilterParams params = noise_removal_filter->getFilterParams();
|
||||||
RCLCPP_INFO_STREAM(logger_, "Default noise removal filter params: "
|
RCLCPP_INFO_STREAM(
|
||||||
<< "disp_diff: " << params.disp_diff
|
logger_, "Default noise removal filter params: " << "disp_diff: " << params.disp_diff
|
||||||
<< ", max_size: " << params.max_size);
|
<< ", max_size: " << params.max_size);
|
||||||
params.disp_diff = noise_removal_filter_min_diff_;
|
params.disp_diff = noise_removal_filter_min_diff_;
|
||||||
params.max_size = noise_removal_filter_max_size_;
|
params.max_size = noise_removal_filter_max_size_;
|
||||||
RCLCPP_INFO_STREAM(logger_, "Set noise removal filter params: "
|
RCLCPP_INFO_STREAM(logger_,
|
||||||
<< "disp_diff: " << params.disp_diff
|
"Set noise removal filter params: " << "disp_diff: " << params.disp_diff
|
||||||
<< ", max_size: " << params.max_size);
|
<< ", max_size: " << params.max_size);
|
||||||
if (noise_removal_filter_min_diff_ != -1 && noise_removal_filter_max_size_ != -1) {
|
if (noise_removal_filter_min_diff_ != -1 && noise_removal_filter_max_size_ != -1) {
|
||||||
noise_removal_filter->setFilterParams(params);
|
noise_removal_filter->setFilterParams(params);
|
||||||
}
|
}
|
||||||
@@ -568,11 +568,11 @@ void OBCameraNode::setupDepthPostProcessFilter() {
|
|||||||
hdr_merge_gain_2_ != -1) {
|
hdr_merge_gain_2_ != -1) {
|
||||||
auto hdr_merge_filter = filter->as<ob::HdrMerge>();
|
auto hdr_merge_filter = filter->as<ob::HdrMerge>();
|
||||||
hdr_merge_filter->enable(true);
|
hdr_merge_filter->enable(true);
|
||||||
RCLCPP_INFO_STREAM(logger_, "Set HDR merge filter params: "
|
RCLCPP_INFO_STREAM(
|
||||||
<< "exposure_1: " << hdr_merge_exposure_1_
|
logger_, "Set HDR merge filter params: " << "exposure_1: " << hdr_merge_exposure_1_
|
||||||
<< ", gain_1: " << hdr_merge_gain_1_
|
<< ", gain_1: " << hdr_merge_gain_1_
|
||||||
<< ", exposure_2: " << hdr_merge_exposure_2_
|
<< ", exposure_2: " << hdr_merge_exposure_2_
|
||||||
<< ", gain_2: " << hdr_merge_gain_2_);
|
<< ", gain_2: " << hdr_merge_gain_2_);
|
||||||
auto config = OBHdrConfig();
|
auto config = OBHdrConfig();
|
||||||
config.enable = true;
|
config.enable = true;
|
||||||
config.exposure_1 = hdr_merge_exposure_1_;
|
config.exposure_1 = hdr_merge_exposure_1_;
|
||||||
@@ -784,6 +784,7 @@ void OBCameraNode::startStreams() {
|
|||||||
pipeline_.reset();
|
pipeline_.reset();
|
||||||
}
|
}
|
||||||
pipeline_ = std::make_unique<ob::Pipeline>(device_);
|
pipeline_ = std::make_unique<ob::Pipeline>(device_);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setupPipelineConfig();
|
setupPipelineConfig();
|
||||||
pipeline_->start(pipeline_config_, [this](const std::shared_ptr<ob::FrameSet> &frame_set) {
|
pipeline_->start(pipeline_config_, [this](const std::shared_ptr<ob::FrameSet> &frame_set) {
|
||||||
@@ -924,6 +925,69 @@ void OBCameraNode::stopIMU() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// cs_param_t rd_par = {0, 0}, param = {1, 3000}; //30
|
||||||
|
int OBCameraNode::openSocSyncPwmTrigger(uint16_t fps) {
|
||||||
|
const char *devicePath = DEVICE_PATH;
|
||||||
|
const int TRIGGER_MODE_ENABLE = 1;
|
||||||
|
const int TRIGGER_MODE_DISABLE = 0;
|
||||||
|
|
||||||
|
int ret = -1;
|
||||||
|
cs_param_t param = {TRIGGER_MODE_ENABLE, fps};
|
||||||
|
cs_param_t rd_par = {TRIGGER_MODE_DISABLE, 0};
|
||||||
|
|
||||||
|
if (access(devicePath, F_OK) != 0) {
|
||||||
|
std::cerr << "Device node " << devicePath << " does not exist." << std::endl;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
gmsl_trigger_fd_ = open(DEVICE_PATH, O_RDWR);
|
||||||
|
if (gmsl_trigger_fd_ < 0) {
|
||||||
|
perror("open device failed\n");
|
||||||
|
return gmsl_trigger_fd_;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "Written param mode=" << param.mode << ", fps=" << param.fps << std::endl;
|
||||||
|
ret = write(gmsl_trigger_fd_, ¶m, sizeof(param));
|
||||||
|
if (ret < 0) {
|
||||||
|
perror("write device failed\n");
|
||||||
|
close(gmsl_trigger_fd_);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = read(gmsl_trigger_fd_, &rd_par, sizeof(rd_par));
|
||||||
|
if (ret < 0) {
|
||||||
|
perror("read device failed\n");
|
||||||
|
close(gmsl_trigger_fd_);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
std::cout << "Read param mode=" << rd_par.mode << ", fps=" << rd_par.fps << std::endl;
|
||||||
|
|
||||||
|
std::cout << "Start hardware triggering..." << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
int OBCameraNode::closeSocSyncPwmTrigger() {
|
||||||
|
if (gmsl_trigger_fd_ >= 0) {
|
||||||
|
close(gmsl_trigger_fd_);
|
||||||
|
gmsl_trigger_fd_ = -1; // Reset file descriptors
|
||||||
|
std::cout << "close camSync success" << std::endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OBCameraNode::startGmslTrigger() {
|
||||||
|
if (gmsl_trigger_fps_ > 0 && enable_gmsl_trigger_) {
|
||||||
|
RCLCPP_WARN_STREAM(logger_, "Start HardwareTrigger by soc-trigger-source. gmsl_trigger_fps_: "
|
||||||
|
<< gmsl_trigger_fps_);
|
||||||
|
openSocSyncPwmTrigger(gmsl_trigger_fps_);
|
||||||
|
} else {
|
||||||
|
RCLCPP_WARN_STREAM(logger_,
|
||||||
|
"Start HardwareTrigger by soc-trigger-source. gmsl_trigger_fps_ illegal: "
|
||||||
|
<< gmsl_trigger_fps_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
void OBCameraNode::stopGmslTrigger() { closeSocSyncPwmTrigger(); }
|
||||||
|
|
||||||
void OBCameraNode::setupDefaultImageFormat() {
|
void OBCameraNode::setupDefaultImageFormat() {
|
||||||
format_[DEPTH] = OB_FORMAT_Y16;
|
format_[DEPTH] = OB_FORMAT_Y16;
|
||||||
format_str_[DEPTH] = "Y16";
|
format_str_[DEPTH] = "Y16";
|
||||||
@@ -1131,6 +1195,8 @@ void OBCameraNode::getParameters() {
|
|||||||
long software_trigger_period = 33;
|
long software_trigger_period = 33;
|
||||||
setAndGetNodeParameter<long>(software_trigger_period, "software_trigger_period", 33);
|
setAndGetNodeParameter<long>(software_trigger_period, "software_trigger_period", 33);
|
||||||
software_trigger_period_ = std::chrono::milliseconds(software_trigger_period);
|
software_trigger_period_ = std::chrono::milliseconds(software_trigger_period);
|
||||||
|
setAndGetNodeParameter<int>(gmsl_trigger_fps_, "gmsl_trigger_fps", 3000);
|
||||||
|
setAndGetNodeParameter<bool>(enable_gmsl_trigger_, "enable_gmsl_trigger", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBCameraNode::setupTopics() {
|
void OBCameraNode::setupTopics() {
|
||||||
@@ -1667,10 +1733,11 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
|
|||||||
auto pid = device_info->getPid();
|
auto pid = device_info->getPid();
|
||||||
auto color_frame = frame_set->getFrame(OB_FRAME_COLOR);
|
auto color_frame = frame_set->getFrame(OB_FRAME_COLOR);
|
||||||
if (isGemini335PID(pid)) {
|
if (isGemini335PID(pid)) {
|
||||||
bool depth_aligned = false;
|
|
||||||
depth_frame = processDepthFrameFilter(depth_frame);
|
depth_frame = processDepthFrameFilter(depth_frame);
|
||||||
if(depth_frame)
|
bool depth_aligned = false;
|
||||||
{ frame_set->pushFrame(depth_frame);}
|
if (depth_frame) {
|
||||||
|
frame_set->pushFrame(depth_frame);
|
||||||
|
}
|
||||||
if (depth_registration_ && align_filter_ && depth_frame && color_frame) {
|
if (depth_registration_ && align_filter_ && depth_frame && color_frame) {
|
||||||
if (auto new_frame = align_filter_->process(frame_set)) {
|
if (auto new_frame = align_filter_->process(frame_set)) {
|
||||||
auto new_frame_set = new_frame->as<ob::FrameSet>();
|
auto new_frame_set = new_frame->as<ob::FrameSet>();
|
||||||
@@ -1986,6 +2053,7 @@ void OBCameraNode::onNewFrameCallback(const std::shared_ptr<ob::Frame> &frame,
|
|||||||
} else {
|
} else {
|
||||||
memcpy(image.data, video_frame->getData(), video_frame->getDataSize());
|
memcpy(image.data, video_frame->getData(), video_frame->getDataSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream_index == DEPTH) {
|
if (stream_index == DEPTH) {
|
||||||
auto depth_scale = video_frame->as<ob::DepthFrame>()->getValueScale();
|
auto depth_scale = video_frame->as<ob::DepthFrame>()->getValueScale();
|
||||||
image = image * depth_scale;
|
image = image * depth_scale;
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ OBCameraNodeDriver::~OBCameraNodeDriver() {
|
|||||||
reset_device_cond_.notify_all();
|
reset_device_cond_.notify_all();
|
||||||
reset_device_thread_->join();
|
reset_device_thread_->join();
|
||||||
}
|
}
|
||||||
|
ob_camera_node_->stopGmslTrigger();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OBCameraNodeDriver::init() {
|
void OBCameraNodeDriver::init() {
|
||||||
@@ -415,6 +416,7 @@ void OBCameraNodeDriver::initializeDevice(const std::shared_ptr<ob::Device> &dev
|
|||||||
|
|
||||||
ob_camera_node_->startIMU();
|
ob_camera_node_->startIMU();
|
||||||
ob_camera_node_->startStreams();
|
ob_camera_node_->startStreams();
|
||||||
|
|
||||||
device_connected_ = true;
|
device_connected_ = true;
|
||||||
device_info_ = device_->getDeviceInfo();
|
device_info_ = device_->getDeviceInfo();
|
||||||
serial_number_ = device_info_->getSerialNumber();
|
serial_number_ = device_info_->getSerialNumber();
|
||||||
@@ -490,6 +492,11 @@ void OBCameraNodeDriver::startDevice(const std::shared_ptr<ob::DeviceList> &list
|
|||||||
end_time = std::chrono::high_resolution_clock::now();
|
end_time = std::chrono::high_resolution_clock::now();
|
||||||
time_cost = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time);
|
time_cost = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time);
|
||||||
RCLCPP_INFO_STREAM(logger_, "Initialize device cost " << time_cost.count() << " ms");
|
RCLCPP_INFO_STREAM(logger_, "Initialize device cost " << time_cost.count() << " ms");
|
||||||
|
|
||||||
|
auto pid = device->getDeviceInfo()->getPid();
|
||||||
|
if (GEMINI_335LG_PID == pid) {
|
||||||
|
ob_camera_node_->startGmslTrigger();
|
||||||
|
}
|
||||||
} catch (ob::Error &e) {
|
} catch (ob::Error &e) {
|
||||||
RCLCPP_ERROR_STREAM(logger_, "Failed to initialize device " << e.getMessage());
|
RCLCPP_ERROR_STREAM(logger_, "Failed to initialize device " << e.getMessage());
|
||||||
start_device_failed = true;
|
start_device_failed = true;
|
||||||
|
|||||||
@@ -459,9 +459,9 @@ void OBCameraNode::setLaserEnableCallback(
|
|||||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response) {
|
std::shared_ptr<std_srvs::srv::SetBool::Response>& response) {
|
||||||
(void)request_header;
|
(void)request_header;
|
||||||
(void)response;
|
(void)response;
|
||||||
bool laser_enable = request->data;
|
int laser_enable = request->data? 1 : 0;
|
||||||
try {
|
try {
|
||||||
device_->setBoolProperty(OB_PROP_LASER_BOOL, laser_enable);
|
device_->setIntProperty(OB_PROP_LASER_CONTROL_INT, laser_enable);
|
||||||
response->success = true;
|
response->success = true;
|
||||||
} catch (const ob::Error& e) {
|
} catch (const ob::Error& e) {
|
||||||
response->message = e.getMessage();
|
response->message = e.getMessage();
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ class MultiCameraSubscriber : public rclcpp::Node {
|
|||||||
int vid = device_info->vid();
|
int vid = device_info->vid();
|
||||||
int pid = device_info->pid();
|
int pid = device_info->pid();
|
||||||
serial_numbers_[usb_port] = serial;
|
serial_numbers_[usb_port] = serial;
|
||||||
RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), ":vid: " << std::hex << vid);
|
RCLCPP_INFO_STREAM(rclcpp::get_logger("multi_save_rgbir_node"), ":vid: " << std::hex << vid);
|
||||||
RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), ":pid: " << std::hex << pid);
|
RCLCPP_INFO_STREAM(rclcpp::get_logger("multi_save_rgbir_node"), ":pid: " << std::hex << pid);
|
||||||
RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), ":serial: " << serial);
|
RCLCPP_INFO_STREAM(rclcpp::get_logger("multi_save_rgbir_node"), ":serial: " << serial);
|
||||||
RCLCPP_INFO_STREAM(rclcpp::get_logger("list_device_node"), ":usb_port: " << usb_port);
|
RCLCPP_INFO_STREAM(rclcpp::get_logger("multi_save_rgbir_node"), ":usb_port: " << usb_port);
|
||||||
color_frame_counters_[count] = 0;
|
color_frame_counters_[count] = 0;
|
||||||
ir_frame_counters_[count] = 0;
|
ir_frame_counters_[count] = 0;
|
||||||
count++;
|
count++;
|
||||||
|
|||||||
+22
-22
@@ -15,7 +15,7 @@ Stephen Brawner ([email protected])
|
|||||||
iyy="1.70686808598814E-06" iyz="-7.18717290327325E-09" izz="1.31766831843134E-05" />
|
iyy="1.70686808598814E-06" iyz="-7.18717290327325E-09" izz="1.31766831843134E-05" />
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="-25 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_link.STL" />
|
<mesh filename="${mesh_path}camera_link.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
@@ -63,7 +63,7 @@ Stephen Brawner ([email protected])
|
|||||||
<axis xyz="0 0 0" />
|
<axis xyz="0 0 0" />
|
||||||
</joint>
|
</joint>
|
||||||
|
|
||||||
<link name="camera_infra_1_frame">
|
<link name="camera_left_ir_frame">
|
||||||
<inertial>
|
<inertial>
|
||||||
<origin xyz="-0.00158020887627678 -1.52683853303637E-08 -1.4860800305164E-07"
|
<origin xyz="-0.00158020887627678 -1.52683853303637E-08 -1.4860800305164E-07"
|
||||||
rpy="0 0 0" />
|
rpy="0 0 0" />
|
||||||
@@ -73,9 +73,9 @@ Stephen Brawner ([email protected])
|
|||||||
iyy="4.84012226840139E-09" iyz="1.92888940614786E-14" izz="4.84044260907388E-09" />
|
iyy="4.84012226840139E-09" iyz="1.92888940614786E-14" izz="4.84044260907388E-09" />
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="-25 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_infra_1_frame.STL" />
|
<mesh filename="${mesh_path}camera_left_ir_frame.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
<material name="">
|
<material name="">
|
||||||
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
|
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
|
||||||
@@ -84,19 +84,19 @@ Stephen Brawner ([email protected])
|
|||||||
<collision>
|
<collision>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="0 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_infra_1_frame.STL" />
|
<mesh filename="${mesh_path}camera_left_ir_frame.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
</collision>
|
</collision>
|
||||||
</link>
|
</link>
|
||||||
|
|
||||||
<joint name="camera_infra_1_joint" type="fixed">
|
<joint name="camera_left_ir_joint" type="fixed">
|
||||||
<origin xyz="0.01587 -0.025 0.0125" rpy="0 0 0" />
|
<origin xyz="0.01587 -0.025 0.0125" rpy="0 0 0" />
|
||||||
<parent link="camera_bottom_screw_frame" />
|
<parent link="camera_bottom_screw_frame" />
|
||||||
<child link="camera_infra_1_frame" />
|
<child link="camera_left_ir_frame" />
|
||||||
<axis xyz="0 0 0" />
|
<axis xyz="0 0 0" />
|
||||||
</joint>
|
</joint>
|
||||||
|
|
||||||
<link name="camera_infra_1_optical_frame">
|
<link name="camera_left_ir_optical_frame">
|
||||||
<inertial>
|
<inertial>
|
||||||
<origin xyz="1.52683853338331E-08 1.48608003051636E-07 -0.00158020887627678" rpy="0 0 0" />
|
<origin xyz="1.52683853338331E-08 1.48608003051636E-07 -0.00158020887627678" rpy="0 0 0" />
|
||||||
<mass value="0.000453168790516429" />
|
<mass value="0.000453168790516429" />
|
||||||
@@ -107,7 +107,7 @@ Stephen Brawner ([email protected])
|
|||||||
<visual>
|
<visual>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="0 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_infra_1_optical_frame.STL" />
|
<mesh filename="${mesh_path}camera_left_ir_optical_frame.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
<material name="">
|
<material name="">
|
||||||
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
|
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
|
||||||
@@ -116,19 +116,19 @@ Stephen Brawner ([email protected])
|
|||||||
<collision>
|
<collision>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="0 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_infra_1_optical_frame.STL" />
|
<mesh filename="${mesh_path}camera_left_ir_optical_frame.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
</collision>
|
</collision>
|
||||||
</link>
|
</link>
|
||||||
|
|
||||||
<joint name="camera_infra_1_optical_joint" type="fixed">
|
<joint name="camera_left_ir_optical_joint" type="fixed">
|
||||||
<origin xyz="0.01587 -0.025 0.0125" rpy="-1.5707963267949 0 -1.5707963267949" />
|
<origin xyz="0.01587 -0.025 0.0125" rpy="-1.5707963267949 0 -1.5707963267949" />
|
||||||
<parent link="camera_bottom_screw_frame" />
|
<parent link="camera_bottom_screw_frame" />
|
||||||
<child link="camera_infra_1_optical_frame" />
|
<child link="camera_left_ir_optical_frame" />
|
||||||
<axis xyz="0 0 0" />
|
<axis xyz="0 0 0" />
|
||||||
</joint>
|
</joint>
|
||||||
|
|
||||||
<link name="camera_infra2_frame">
|
<link name="camera_right_ir_frame">
|
||||||
<inertial>
|
<inertial>
|
||||||
<origin xyz="-0.00158020887627678 -1.52683853303637E-08 -1.48608003050581E-07"
|
<origin xyz="-0.00158020887627678 -1.52683853303637E-08 -1.48608003050581E-07"
|
||||||
rpy="0 0 0" />
|
rpy="0 0 0" />
|
||||||
@@ -140,7 +140,7 @@ Stephen Brawner ([email protected])
|
|||||||
<visual>
|
<visual>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="0 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_infra2_frame.STL" />
|
<mesh filename="${mesh_path}camera_right_ir_frame.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
<material name="">
|
<material name="">
|
||||||
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
|
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
|
||||||
@@ -149,19 +149,19 @@ Stephen Brawner ([email protected])
|
|||||||
<collision>
|
<collision>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="0 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_infra2_frame.STL" />
|
<mesh filename="${mesh_path}camera_right_ir_frame.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
</collision>
|
</collision>
|
||||||
</link>
|
</link>
|
||||||
|
|
||||||
<joint name="camera_infra2_joint" type="fixed">
|
<joint name="camera_right_ir_joint" type="fixed">
|
||||||
<origin xyz="0.01587 0.025 0.0125" rpy="0 0 0" />
|
<origin xyz="0.01587 0.025 0.0125" rpy="0 0 0" />
|
||||||
<parent link="camera_bottom_screw_frame" />
|
<parent link="camera_bottom_screw_frame" />
|
||||||
<child link="camera_infra2_frame" />
|
<child link="camera_right_ir_frame" />
|
||||||
<axis xyz="0 0 0" />
|
<axis xyz="0 0 0" />
|
||||||
</joint>
|
</joint>
|
||||||
|
|
||||||
<link name="camera_infra2_optical_frame">
|
<link name="camera_right_ir_optical_frame">
|
||||||
<inertial>
|
<inertial>
|
||||||
<origin xyz="1.52683853268942E-08 1.4860800305058E-07 -0.00158020887627678" rpy="0 0 0" />
|
<origin xyz="1.52683853268942E-08 1.4860800305058E-07 -0.00158020887627678" rpy="0 0 0" />
|
||||||
<mass value="0.000453168790516429" />
|
<mass value="0.000453168790516429" />
|
||||||
@@ -172,7 +172,7 @@ Stephen Brawner ([email protected])
|
|||||||
<visual>
|
<visual>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="0 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_infra2_optical_frame.STL" />
|
<mesh filename="${mesh_path}camera_right_ir_optical_frame.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
<material name="">
|
<material name="">
|
||||||
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
|
<color rgba="0.501960784313725 0.250980392156863 0.250980392156863 1" />
|
||||||
@@ -181,15 +181,15 @@ Stephen Brawner ([email protected])
|
|||||||
<collision>
|
<collision>
|
||||||
<origin xyz="0 0 0" rpy="0 0 0" />
|
<origin xyz="0 0 0" rpy="0 0 0" />
|
||||||
<geometry>
|
<geometry>
|
||||||
<mesh filename="${mesh_path}camera_infra2_optical_frame.STL" />
|
<mesh filename="${mesh_path}camera_right_ir_optical_frame.STL" />
|
||||||
</geometry>
|
</geometry>
|
||||||
</collision>
|
</collision>
|
||||||
</link>
|
</link>
|
||||||
|
|
||||||
<joint name="camera_infra2_optical_joint" type="fixed">
|
<joint name="camera_right_ir_optical_joint" type="fixed">
|
||||||
<origin xyz="0.01587 0.025 0.0125" rpy="-1.5707963267949 0 -1.5707963267949" />
|
<origin xyz="0.01587 0.025 0.0125" rpy="-1.5707963267949 0 -1.5707963267949" />
|
||||||
<parent link="camera_bottom_screw_frame" />
|
<parent link="camera_bottom_screw_frame" />
|
||||||
<child link="camera_infra2_optical_frame" />
|
<child link="camera_right_ir_optical_frame" />
|
||||||
<axis xyz="0 0 0" />
|
<axis xyz="0 0 0" />
|
||||||
</joint>
|
</joint>
|
||||||
|
|
||||||
Reference in New Issue
Block a user