Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
amarburg committed Aug 30, 2023
2 parents c2812d4 + ec6c882 commit 775f749
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 515 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
## Arena Camera Driver for ROS2

**Project Status:** This software is a work in progress. At present it is an in-progrss port of our [ROS1 LucidVision Driver](https://github.com/apl-ocean-engineering/arena_camera_ros) driver and is not feature-complete.
**Project Status:** This software is a work in progress. At present the streaming node is functional with the sample cameras which are available to us (a [PHX122S](https://thinklucid.com/product/phoenix-12-2-mp-imx226/) and a [TRI054S](https://thinklucid.com/product/triton-5-mp-imx490/) for testing HDR modes). The polled node is not functional.

This repo is a ROS2 driver for LucidVision machine vision camera using their ["Arena" SDK for Ubuntu](https://thinklucid.com/downloads-hub/).
---

This package is a ROS2 driver for LucidVision machine vision camera using their ["Arena" SDK for Ubuntu](https://thinklucid.com/downloads-hub/).

This particular version is forked from the upstream [driver published by LucidVision](https://github.com/lucidvisionlabs/arena_camera_ros2) and includes significant refactoring for functionality / readability.

See also [arena_camera_ros](https://github.com/apl-ocean-engineering/arena_camera_ros) for ROS1.

# Getting Started

This package builds as a standard ROS2 package using `colcon`, however the [Arena SDK](https://thinklucid.com/downloads-hub/) must be installed.
Expand All @@ -14,7 +18,7 @@ See the [ROS2 documentation at LucidVision](https://support.thinklucid.com/using

# Getting Started -- with Docker

A full Dockerfile is included in the [.docker](.docker/) directory. See the [README in that directory](.docker/README.md) for more details.
A full [Dockerfile](.docker/Dockerfile) is included in the [.docker/](.docker/) directory. See the [README in that directory](.docker/README.md) for more details.

# Contents

Expand Down
1 change: 1 addition & 0 deletions arena_camera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set(THIS_PACKAGE_INCLUDE_DEPENDS
ament_cmake
camera_control_msgs
camera_info_manager
diagnostic_msgs
diagnostic_updater
image_transport
imaging_msgs
Expand Down
23 changes: 9 additions & 14 deletions arena_camera/include/arena_camera/arena_camera_nodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ class ArenaCameraBaseNode : public rclcpp::Node {
///
float currentGamma();

// ~~~ Camera Lookup Tables ~~~

/// Enable/disable lookup table (LUT) in camera.
/// @param enable Whether to enable/disable the camera LUT
///
void enableLUT(bool enable);

// ~~~ HDR metadata (IMX490 only) ~~~

float currentHdrGain(int channel);
Expand Down Expand Up @@ -253,12 +260,6 @@ class ArenaCameraBaseNode : public rclcpp::Node {
// */
// float calcCurrentBrightness();

// /**
// * Enable/disable lookup table (LUT) in camera.
// * @param enable Whether to enable/disable the camera LUT
// */
// void enableLUT(bool enable);

protected:
/// @brief
/// @param cam_info_msg
Expand Down Expand Up @@ -302,14 +303,9 @@ class ArenaCameraBaseNode : public rclcpp::Node {
// std::vector<std::size_t> sampling_indices_;
// // std::array<float, 256> brightness_exp_lut_;

// boost::recursive_mutex device_mutex_;

// /// diagnostics:
/// diagnostics:
std::shared_ptr<diagnostic_updater::Updater> diagnostics_updater_;

// rclcpp::TimerBase::SharedPtr diagnostics_timer_;
// void updateDiagnosticsCb(void);

void create_diagnostics(diagnostic_updater::DiagnosticStatusWrapper &stat);
void create_camera_info_diagnostics(
diagnostic_updater::DiagnosticStatusWrapper &stat);
Expand Down Expand Up @@ -353,14 +349,13 @@ class ArenaCameraStreamingNode : public ArenaCameraBaseNode {
void newImageCb(Arena::IImage *pImage);
};

/// ArenaCameraPolledNode is not currently implemented.
class ArenaCameraPolledNode : public ArenaCameraBaseNode {
public:
ArenaCameraPolledNode(
const rclcpp::NodeOptions &options = rclcpp::NodeOptions());
virtual ~ArenaCameraPolledNode();

// void onInit() override;

/**
* Callback for the grab images action
* @param goal the goal
Expand Down
27 changes: 14 additions & 13 deletions arena_camera/include/arena_camera/encoding_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,27 @@
namespace arena_camera {

namespace encoding_conversions {
/**
* Converts an encoding from the sensor_msgs/image_encodings.h list into
* the GenAPI language.
* @return true in case that an corresponding conversion could be found and
* false otherwise.
*/

/// Converts an encoding from the sensor_msgs/image_encodings.h list into
/// the GenAPI language.
///
/// @return true in case that an corresponding conversion could be found and
/// false otherwise.
///
bool ros2GenAPI(const std::string& ros_enc, std::string& gen_api_enc);

/**
* Converts an encoding described in GenAPI language into the ROS encoding
* language. The ROS encodings are listed in sensor_msgs/image_encodings.h
* @return true in case that an corresponding conversion could be found and
* false otherwise.
*/
/// Converts an encoding described in GenAPI language into the ROS encoding
/// language. The ROS encodings are listed in sensor_msgs/image_encodings.h
///
/// @return true in case that an corresponding conversion could be found and
/// false otherwise.
///
bool genAPI2Ros(const std::string& gen_api_enc, std::string& ros_enc);

///
/// @brief Is the given ROS encoding an HDR type?
///
/// @return true if ros_enc is an HDR image encoding
///
bool isHDR(const std::string& ros_enc);

} // namespace encoding_conversions
Expand Down
25 changes: 20 additions & 5 deletions arena_camera/launch/streaming.launch.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
# Copyright 2023 University of Washington
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS”
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


from launch import LaunchDescription
Expand Down
1 change: 1 addition & 0 deletions arena_camera/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<depend>camera_control_msgs</depend>
<depend>camera_info_manager</depend>
<depend>diagnostic_msgs</depend>
<depend>diagnostic_updater</depend>
<depend>generate_parameter_library</depend>
<depend>image_transport</depend>
Expand Down
Loading

0 comments on commit 775f749

Please sign in to comment.