Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into iron
Browse files Browse the repository at this point in the history
  • Loading branch information
InvincibleRMC committed Dec 9, 2023
2 parents 2af2cca + 508af0c commit 06edf0c
Show file tree
Hide file tree
Showing 15 changed files with 425 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/surface/ps5_controller/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ros2 launch ps5-controller controller_launch.py

* **`/joy`** ([sensor_msgs/Joy])

Outdated ROV movement instructions
Information about the controller input.

## Subscribed Topics

Expand Down
2 changes: 1 addition & 1 deletion src/surface/ps5_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package format="3">
<name>ps5_controller</name>
<version>1.0.0</version>
<description>Biolerplate for calling standard joystick launch file.</description>
<description>Boilerplate for calling standard joystick launch file.</description>
<maintainer email="rmc170@case.edu">Michael Carlstrom</maintainer>
<license>Apache License 2.0</license>

Expand Down
2 changes: 1 addition & 1 deletion src/surface/ps5_controller/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
zip_safe=True,
maintainer='Michael Carlstrom',
maintainer_email='rmc170@case.edu',
description='Biolerplate for calling standard joystick launch file.',
description='Boilerplate for calling standard joystick launch file.',
license='Apache License 2.0',
tests_require=['pytest'],
entry_points={},
Expand Down
2 changes: 1 addition & 1 deletion src/surface/ros2_video_streamer
74 changes: 74 additions & 0 deletions src/surface/rov_flir/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# rov_flir

## Overview

This is a boilerplate package which launches the camera_driver_node from the flir_launch package.

## Setup

Run the setup file from spinnaker_camera_driver

```bash
ros2 run spinnaker_camera_driver linux_setup_flir
```

## Debugging

You can install the Spinnaker SDK & Spinview GUI for debugging [here](https://www.flir.com/products/spinnaker-sdk/).

If you get errors about cameras on the wrong subnet, install this and open Spinview. Write click the entries for each camera and select "Auto Force IPs".

## Usage

Run the main node with

```bash
ros2 launch rov_flir flir_launch.py
```

## Settings

In the config folder are the nodes from the spinnaker api, these are different from ROS nodes. They are basically settings of the cameras. Each setting in the config file has a `name` which is the name of the ROS parameter, a `type` which is the data type of the field, and finally each setting has a `node` which is the name of the setting in spinnaker.

## Launch files

* **flir_launch.py:** Launches the camera_driver_node for the two flir cameras.

## Published Topics

* **`/front_camera/image_raw`** ([sensor_msgs/msg/Image])

Image feed for front camera.

* **`/front_camera/meta`** ([flir_camera_msgs/msg/ImageMetaData])

Front camera image meta data.

* **`/front_camera/camera_info`** ([sensor_msgs/msg/CameraInfo])

Front camera info.

* **`/bottom_camera/image_raw`** ([sensor_msgs/msg/Image])

Image feed for bottom camera.

* **`/bottom_camera/meta`** ([flir_camera_msgs/msg/ImageMetaData])

Bottom camera image meta data.

* **`/bottom_camera/camera_info`** ([sensor_msgs/msg/CameraInfo])

Bottom camera info.

## Subscribed Topics

* **`/front_camera/control`** ([flir_camera_msgs/msg/CameraControl])
Controls exposure and gain.

* **`/bottom_camera/control`** ([flir_camera_msgs/msg/CameraControl])
Controls exposure and gain.

[sensor_msgs/msg/Image]: https://docs.ros2.org/latest/api/sensor_msgs/msg/Image.html
[flir_camera_msgs/msg/ImageMetaData]: https://github.com/ros-drivers/flir_camera_driver/blob/humble-devel/flir_camera_msgs/msg/ImageMetaData.msg
[sensor_msgs/msg/CameraInfo]: https://docs.ros2.org/latest/api/sensor_msgs/msg/CameraInfo.html
[flir_camera_msgs/msg/CameraControl]: https://github.com/ros-drivers/flir_camera_driver/blob/humble-devel/flir_camera_msgs/msg/CameraControl.msg
154 changes: 154 additions & 0 deletions src/surface/rov_flir/config/blackfly_s.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
#
# config file for blackfly S cameras (USB3 and GigE)
#
# This file maps the ros parameters to the corresponding Spinnaker "nodes" in the camera.
# For more details on how to modify this file, see the README on camera configuration files.


parameters:
#
# -------- image format control
#
- name: pixel_format
type: enum
# Check available values with SpinView. Not all are supported by ROS!
# Some formats are e.g. "Mono8", "BayerRG8", "BGR8", "BayerRG16"
# default is "BayerRG8"
node: ImageFormatControl/PixelFormat
- name: image_width
type: int
node: ImageFormatControl/Width
- name: image_height
type: int
node: ImageFormatControl/Height
- name: offset_x # offset must come after image width reduction!
type: int
node: ImageFormatControl/OffsetX
- name: offset_y
type: int
node: ImageFormatControl/OffsetY
# Added by ROV
- name: binning_x
type: int
node: ImageFormatControl/BinningHorizontal
- name: binning_y
type: int
node: ImageFormatControl/BinningVertical
#
# -------- analog control
#
- name: gain_auto
type: enum
# valid values are "Continuous", "Off"
node: AnalogControl/GainAuto
- name: gain
type: float
node: AnalogControl/Gain
#
# -------- device link throughput limiting
#
- name: device_link_throughput_limit
type: int
node: DeviceControl/DeviceLinkThroughputLimit
#
# -------- transport layer control (GigE)
#
- name: gev_scps_packet_size
type: int
# default is 1400. Set to 9000 to enable jumbo frames, ensure NIC MTU set >= 9000
node: TransportLayerControl/GigEVision/GevSCPSPacketSize
#
# -------- digital IO control
#
- name: line0_selector # black wire: opto-isolated input
type: enum
node: DigitalIOControl/LineSelector
- name: line1_selector # white wire: opto-isolated output
type: enum
node: DigitalIOControl/LineSelector
- name: line1_linemode # valid values: "Input", "Output"
type: enum
node: DigitalIOControl/LineMode
- name: line2_selector # red wire: non-isolated input/output
type: enum
node: DigitalIOControl/LineSelector
- name: line2_v33enable # red wire: 3.3V power
type: bool
node: DigitalIOControl/V3_3Enable
- name: line3_selector # green wire: aux voltage input and non-isolated input
type: enum
node: DigitalIOControl/LineSelector
- name: line3_linemode # valid values: "Input", "Output"
type: enum
node: DigitalIOControl/LineMode
#
# -------- acquisition control
#
- name: exposure_auto
type: enum
# valid values are "Off", "Continuous"
node: AcquisitionControl/ExposureAuto
- name: exposure_time
type: float
node: AcquisitionControl/ExposureTime
- name: frame_rate_enable
type: bool
node: AcquisitionControl/AcquisitionFrameRateEnable
- name: frame_rate
type: float
node: AcquisitionControl/AcquisitionFrameRate
- name: trigger_selector
type: enum
# valid values are e.g. "FrameStart", "AcquisitionStart", "FrameBurstStart"
node: AcquisitionControl/TriggerSelector
- name: trigger_mode
type: enum
# valid values are "On" and "Off"
node: AcquisitionControl/TriggerMode
- name: trigger_source
type: enum
# valid values are "Line<0,1,2>", "UserOutput<0,1,2>", "Counter<0,1><Start/End>",
# "LogicBlock<0,1>
node: AcquisitionControl/TriggerSource
- name: trigger_delay
# value >= 9
type: float
node: AcquisitionControl/TriggerDelay
- name: trigger_overlap
type: enum
# valid values: "Off" and "ReadOut"
node: AcquisitionControl/TriggerOverlap
#
# --------- chunk control
#
- name: chunk_mode_active
type: bool
node: ChunkDataControl/ChunkModeActive
- name: chunk_selector_frame_id
type: enum
# valid values: "FrameID"
node: ChunkDataControl/ChunkSelector
- name: chunk_enable_frame_id
type: bool
node: ChunkDataControl/ChunkEnable
- name: chunk_selector_exposure_time
type: enum
# valid values: "ExposureTime"
node: ChunkDataControl/ChunkSelector
- name: chunk_enable_exposure_time
type: bool
node: ChunkDataControl/ChunkEnable
- name: chunk_selector_gain
type: enum
# valid values: "Gain"
node: ChunkDataControl/ChunkSelector
- name: chunk_enable_gain
type: bool
node: ChunkDataControl/ChunkEnable
- name: chunk_selector_timestamp
type: enum
# valid values: "Timestamp"
node: ChunkDataControl/ChunkSelector
- name: chunk_enable_timestamp
type: bool
node: ChunkDataControl/ChunkEnable
76 changes: 76 additions & 0 deletions src/surface/rov_flir/launch/flir_launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import os

from ament_index_python.packages import get_package_share_directory
from launch.launch_description import LaunchDescription
from launch_ros.actions import Node
from launch_ros.parameter_descriptions import Parameter


def generate_launch_description() -> LaunchDescription:

parameter_file = os.path.join(get_package_share_directory('rov_flir'), 'config',
'blackfly_s.yaml')

parameters = {
'debug': False,
'compute_brightness': False,
'adjust_timestamp': True,
'dump_node_map': False,
# set parameters defined in blackfly_s.yaml
'gain_auto': 'Continuous',
# 'pixel_format': 'BayerRG8',
'exposure_auto': 'Continuous',
# These are useful for GigE cameras
'device_link_throughput_limit': 125000000,
'gev_scps_packet_size': 9000,
# ---- to reduce the sensor width and shift the crop
# 'image_width': 1280,
# 'image_height': 720,
# 'offset_x': 16,
# 'offset_y': 0,
'binning_x': 2,
'binning_y': 2,
'frame_rate_auto': 'Off',
'frame_rate': 60.0,
'frame_rate_enable': True,
'buffer_queue_size': 1,
'trigger_mode': 'Off',
'chunk_mode_active': True,
'chunk_selector_frame_id': 'FrameID',
'chunk_enable_frame_id': True,
'chunk_selector_exposure_time': 'ExposureTime',
'chunk_enable_exposure_time': True,
'chunk_selector_gain': 'Gain',
'chunk_enable_gain': True,
'chunk_selector_timestamp': 'Timestamp',
'chunk_enable_timestamp': True
}

# launches node to run front flir camera
front_cam: Node = Node(
package='spinnaker_camera_driver',
executable='camera_driver_node',
name='front_camera',
emulate_tty=True,
output='screen',
parameters=[Parameter('serial_number', '23473577'),
Parameter('parameter_file', parameter_file),
parameters]
)

# launches node to run bottom flir camera
bottom_cam: Node = Node(
package='spinnaker_camera_driver',
executable='camera_driver_node',
name='bottom_camera',
emulate_tty=True,
output='screen',
parameters=[Parameter('serial_number', '23473566'),
Parameter('parameter_file', parameter_file),
parameters]
)

return LaunchDescription([
front_cam,
bottom_cam
])
20 changes: 20 additions & 0 deletions src/surface/rov_flir/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>rov_flir</name>
<version>1.0.0</version>
<description>Boilerplate for calling flir launch file.</description>
<maintainer email="rmc170@case.edu">Michael Carlstrom</maintainer>
<license>Apache License 2.0</license>

<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>python3-pytest</test_depend>

<exec_depend>ros2launch</exec_depend>
<exec_depend>spinnaker_camera_driver</exec_depend>

<export>
<build_type>ament_python</build_type>
</export>
</package>
Empty file.
Empty file.
4 changes: 4 additions & 0 deletions src/surface/rov_flir/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[develop]
script_dir=$base/lib/rov_flir
[install]
install_scripts=$base/lib/rov_flir
30 changes: 30 additions & 0 deletions src/surface/rov_flir/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import os
from glob import glob

from setuptools import setup

package_name = 'rov_flir'

setup(
name=package_name,
version='1.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
# Include all launch files.
(os.path.join('share', package_name, 'launch'),
glob('launch/*launch.[pxy][yma]*')),
(os.path.join('share', package_name, 'config'),
glob('config/*'))
],
install_requires=['setuptools'],
zip_safe=True,
maintainer='Michael Carlstrom',
maintainer_email='rmc170@case.edu',
description='Boilerplate for calling standard flir launch file.',
license='Apache License 2.0',
tests_require=['pytest'],
entry_points={},
)
Loading

0 comments on commit 06edf0c

Please sign in to comment.