Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes and improvements, fixed pixel formats and added external trigger on SyncIn2. #50

Open
wants to merge 11 commits into
base: kinetic
Choose a base branch
from
79 changes: 48 additions & 31 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,50 @@
# Specific files
src/VimbaCPP/

# Build objects
lib/
bin/
build/
docs/

# Auto generated code
cfg/cpp/
cfg/*.cfgc
msg_gen/
msg/lisp/

# CMake files
CMakeCache.txt
cmake_install.cmake
CMakeFiles/
src/*/Makefile
src/*/cmake_install.cmake
src/*/CMakeFiles/

# Eclipse temporary files
.cproject
.project
.pydevproject

# ctags
.tags*
*/.tags*
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore

# Node artifact files
node_modules/
dist/

# Compiled Java class files
*.class

# Compiled Python bytecode
*.py[cod]

# Log files
*.log

# Package files
*.jar

# Maven
target/
dist/

# JetBrains IDE
.idea/

# Unit test reports
TEST*.xml

# Generated by MacOS
.DS_Store

# Generated by Windows
Thumbs.db

# Applications
*.app
*.exe
*.war

# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

35 changes: 32 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@
Changelog for package avt_vimba_camera
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.0.12 (2020-06-05)
-------------------
* Fix MonoCamera nodelet (`#16 <https://github.com/astuff/avt_vimba_camera/issues/16>`_)
* Launch File Updates (`#13 <https://github.com/astuff/avt_vimba_camera/issues/13>`_)

* Standardize launch file formatting, remove commented code
* Provide args for all parameters
* Launch file for Mako G-319

* Remove duplicated launch file installs (`#15 <https://github.com/astuff/avt_vimba_camera/issues/15>`_)
* Brief README (`#10 <https://github.com/astuff/avt_vimba_camera/issues/10>`_)
* Add more pixelformats, thanks to @jmoreau-hds (`#3 <https://github.com/astuff/avt_vimba_camera/issues/3>`_)
* Contributors: icolwell-as

0.0.11 (2019-08-19)
-------------------
* Merge pull request `#35 <https://github.com/astuff/avt_vimba_camera/issues/35>`_ from willcbaker/feature/nodelet
Feature/nodelet
* Update nodelet launch files
* Add nodelet
* Fix `#31 <https://github.com/astuff/avt_vimba_camera/issues/31>`_
* Merge pull request `#30 <https://github.com/astuff/avt_vimba_camera/issues/30>`_ from chewwt/armv8
add support for armv8
* add support for armv8
* Change frame observer to shared ptr
* Contributors: Miquel Massot, Will Baker, ruth

0.0.10 (2017-08-16)
-------------------
* Merge pull request `#26 <https://github.com/srv/avt_vimba_camera/issues/26>`_ from 130s/k/add_ci
Expand Down Expand Up @@ -30,9 +57,11 @@ Changelog for package avt_vimba_camera
* Change variable scope
* Fix `#15 <https://github.com/srv/avt_vimba_camera/issues/15>`_: do not depend on turbot_configurations
* Merge pull request `#14 <https://github.com/srv/avt_vimba_camera/issues/14>`_ from josepqp/kinetic
* 1) Added ARM 32 bits libraries
2) Modified CMakeList.txt to compile with ARM 32 bits
3) Added Iris Parameter

* Added ARM 32 bits libraries
* Modified CMakeList.txt to compile with ARM 32 bits
* Added Iris Parameter

* kinetization
* Fix sync problems after camera tests
* Add a sync timer
Expand Down
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ add_dependencies_and_linkings(sync_node)
add_library(avt_camera_nodelets
src/nodes/mono_camera_nodelet.cpp
src/nodes/stereo_camera_nodelet.cpp
src/mono_camera.cpp
src/stereo_camera.cpp
src/avt_vimba_camera.cpp
src/frame_observer.cpp)
Expand All @@ -143,10 +144,6 @@ install(DIRECTORY include
## Mark other files for installation (e.g. launch and bag files, etc.)
install(FILES
plugins.xml
launch/mono_camera.launch
launch/mono_camera_nodelet.launch
launch/stereo_camera_one_node.launch
launch/stereo_camera_two_nodes.launch
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# avt_vimba_camera

This repo contains a ROS driver for cameras manufactured by [Allied Vision Technologies](https://www.alliedvision.com).
The driver relies on libraries provided by AVT as part of their [Vimba SDK](https://www.alliedvision.com/en/products/software.html).

## Installing the driver

You can install via ROS package repos:
```
sudo apt install ros-$ROS_DISTRO-avt-vimba-camera
```
46 changes: 35 additions & 11 deletions cfg/AvtVimbaCamera.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,39 @@ acquisition_mode_enum = gen.enum( [ gen.const("Continuous", str_t, "Continuous"
gen.const("SingleFrame", str_t, "SingleFrame", "The camera will only deliver a single frame trigger event"),
gen.const("MultiFrame", str_t, "MultiFrame", "The camera will acquire the number of images specified by `~AcquisitionFrameCount`. Further trigger events will be ignored"),
gen.const("Recorder", str_t, "Recorder", "The camera will continuously record images into the camera on-board memory")], "Set Trigger Mode")
# Monochrome cameras have mono8,12 and 12Packed. Color cameras have only mono8.
pixelformat_enum = gen.enum([ gen.const("Mono8", str_t, "Mono8", ""),
gen.const("Mono12", str_t, "Mono12", ""),
gen.const("Mono12Packed", str_t, "Mono12Packed", ""),
gen.const("BayerRG8", str_t, "BayerRG8", ""),
gen.const("BayerRG12Packed", str_t, "BayerRG12Packed", ""),
gen.const("BayerGR12", str_t, "BayerGR12", ""),
gen.const("RGB8Packed", str_t, "RGB8Packed", ""),
gen.const("BGR8Packed", str_t, "BGR8Packed", "")], "Set Pixel Format")

# NOTE: Your AVT camera model likely doesn't support all these formats,
# check the datasheet to confirm which formats are supported.
pixelformat_enum = gen.enum([
gen.const("Mono8", str_t, "Mono8", ""),
gen.const("Mono10", str_t, "Mono10", ""),
gen.const("Mono10Packed", str_t, "Mono10Packed", ""),
gen.const("Mono12", str_t, "Mono12", ""),
gen.const("Mono12Packed", str_t, "Mono12Packed", ""),
gen.const("BayerGR8", str_t, "BayerGR8", ""),
gen.const("BayerRG8", str_t, "BayerRG8", ""),
gen.const("BayerGB8", str_t, "BayerGB8", ""),
gen.const("BayerBG8", str_t, "BayerBG8", ""),
gen.const("BayerGR10", str_t, "BayerGR10", ""),
gen.const("BayerRG10", str_t, "BayerRG10", ""),
gen.const("BayerGB10", str_t, "BayerGB10", ""),
gen.const("BayerBG10", str_t, "BayerBG10", ""),
gen.const("BayerGR12", str_t, "BayerGR12", ""),
gen.const("BayerRG12", str_t, "BayerRG12", ""),
gen.const("BayerGB12", str_t, "BayerGB12", ""),
gen.const("BayerBG12", str_t, "BayerBG12", ""),
gen.const("BayerGR10Packed", str_t, "BayerGR10Packed", ""),
gen.const("BayerRG10Packed", str_t, "BayerRG10Packed", ""),
gen.const("BayerGB10Packed", str_t, "BayerGB10Packed", ""),
gen.const("BayerBG10Packed", str_t, "BayerBG10Packed", ""),
gen.const("BayerGR12Packed", str_t, "BayerGR12Packed", ""),
gen.const("BayerRG12Packed", str_t, "BayerRG12Packed", ""),
gen.const("BayerGB12Packed", str_t, "BayerGB12Packed", ""),
gen.const("BayerBG12Packed", str_t, "BayerBG12Packed", ""),
gen.const("RGB8Packed", str_t, "RGB8Packed", ""),
gen.const("BGR8Packed", str_t, "BGR8Packed", "")
], "Set Pixel Format")

auto_enum = gen.enum([ gen.const("Off", str_t, "Off", ""),
gen.const("Once", str_t, "Once", ""),
gen.const("Auto", str_t, "Continuous", "")], "Set Automatic Control")
Expand Down Expand Up @@ -79,7 +103,7 @@ gen.add("frame_id", str_t, SensorLevels.RECONFIGURE_RUNNING, "The
gen.add("trig_timestamp_topic", str_t, SensorLevels.RECONFIGURE_STOP, "Sets the topic from which an externally trigged camera receives its trigger timestamps.", "")
# ACQUISITION
gen.add("acquisition_mode", str_t, SensorLevels.RECONFIGURE_STOP, "Camera acquisition mode", "Continuous", edit_method = acquisition_mode_enum)
gen.add("acquisition_rate", double_t, SensorLevels.RECONFIGURE_RUNNING, "Sets the expected triggering rate in externally triggered mode.", 2, 1, 30)
gen.add("acquisition_rate", double_t, SensorLevels.RECONFIGURE_RUNNING, "Sets the expected triggering rate in externally triggered mode.", 2, 0.001, 30)
# TRIGGER
gen.add("trigger_source", str_t, SensorLevels.RECONFIGURE_STOP, "Camera trigger source", "FixedRate", edit_method = trigger_source_enum)
gen.add("trigger_mode", str_t, SensorLevels.RECONFIGURE_STOP, "Camera trigger mode", "On", edit_method = trigger_mode_enum)
Expand Down Expand Up @@ -117,7 +141,7 @@ gen.add("binning_y", int_t, SensorLevels.RECONFIGURE_RUNNING, "Num
gen.add("decimation_x", int_t, SensorLevels.RECONFIGURE_RUNNING, "Number of decimation operations in x.", 1, 1, 8)
gen.add("decimation_y", int_t, SensorLevels.RECONFIGURE_RUNNING, "Number of decimation operations in y.", 1, 1, 8)
# ROI
gen.add("width", int_t, SensorLevels.RECONFIGURE_RUNNING, "Width of the region of interest (0 for automatic).", 4096, 1, 4096)
gen.add("width", int_t, SensorLevels.RECONFIGURE_RUNNING, "Width of the region of interest (0 for automatic).", 4112, 1, 4112)
gen.add("height", int_t, SensorLevels.RECONFIGURE_RUNNING, "Height of the region of interest (0 for automatic).", 4096, 1, 4096)
gen.add("roi_width", int_t, SensorLevels.RECONFIGURE_RUNNING, "X offset of the region of interest.", 0, 0, 4095)
gen.add("roi_height", int_t, SensorLevels.RECONFIGURE_RUNNING, "X offset of the region of interest.", 0, 0, 4095)
Expand Down
11 changes: 10 additions & 1 deletion include/avt_vimba_camera/avt_vimba_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ class AvtVimbaApi {
else if (pixel_format == VmbPixelFormatBayerGB10 ) encoding = sensor_msgs::image_encodings::TYPE_16SC1;
else if (pixel_format == VmbPixelFormatBayerBG10 ) encoding = sensor_msgs::image_encodings::TYPE_16SC1;
else if (pixel_format == VmbPixelFormatBayerGR12 ) encoding = sensor_msgs::image_encodings::TYPE_16SC1;
else if (pixel_format == VmbPixelFormatBayerRG12 ) encoding = sensor_msgs::image_encodings::TYPE_16SC1;
// dcasa: fixed BayerRG8 image encoding
else if (pixel_format == VmbPixelFormatBayerRG12 ) encoding = sensor_msgs::image_encodings::BAYER_RGGB16;
else if (pixel_format == VmbPixelFormatBayerGB12 ) encoding = sensor_msgs::image_encodings::TYPE_16SC1;
else if (pixel_format == VmbPixelFormatBayerBG12 ) encoding = sensor_msgs::image_encodings::TYPE_16SC1;
else if (pixel_format == VmbPixelFormatBayerGR12Packed) encoding = sensor_msgs::image_encodings::TYPE_32SC4;
Expand All @@ -153,12 +154,20 @@ class AvtVimbaApi {
VmbErrorType err = vimba_frame_ptr->GetImage(buffer_ptr);
bool res = false;
if ( VmbErrorSuccess == err ) {
// dcasa: scale 12 bit image to 16 bit container
if (pixel_format == VmbPixelFormatBayerRG12) {
unsigned short *buffer_ptr_uint16 = (unsigned short *)buffer_ptr;
for (unsigned int i=0; i<nSize/2; i++) {
buffer_ptr_uint16[i]<<=4;
}
}
res = sensor_msgs::fillImage(image,
encoding,
height,
width,
step,
buffer_ptr);

} else {
ROS_ERROR_STREAM("[" << ros::this_node::getName()
<< "]: Could not GetImage. "
Expand Down
23 changes: 23 additions & 0 deletions launch/Mako_G-319.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<launch>
<arg name="name" default="camera" doc="The name of the camera"/>
<arg name="frame_id" default="camera" doc="The frame id of the camera"/>
<arg name="ip" default="" doc="The IP for the camera to connect to"/>
<arg name="guid" default="" doc="The GUID for the camera to connect to"/>
<arg name="camera_info_url" default="file://$(find avt_vimba_camera)/calibrations/calibration_50-0503343290.yaml"/>
<arg name="acquisition_rate" default="10" doc="Camera framerate (Hz)"/>

<include file="$(find avt_vimba_camera)/launch/mono_camera.launch">
<arg name="name" value="$(arg name)"/>
<arg name="frame_id" value="$(arg frame_id)"/>
<arg name="ip" value="$(arg ip)"/>
<arg name="guid" value="$(arg guid)"/>
<arg name="camera_info_url" value="$(arg camera_info_url)"/>
<arg name="acquisition_rate" value="$(arg acquisition_rate)"/>

<!-- Params specific to Mako G-319 -->
<arg name="pixel_format" value="BayerRG8"/>
<arg name="width" value="2064"/>
<arg name="height" value="1544"/>
<arg name="stream_bytes_per_second" value="119824282"/>
</include>
</launch>
16 changes: 8 additions & 8 deletions launch/calibration.launch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<launch>
<arg name="stereo" default="stereo"/>
<node pkg="camera_calibration" type="cameracalibrator.py" name="camera_calibrator" args="-k 6 --size 8x6 --square=0.04" output="screen">
<remap from="left" to="$(arg stereo)/left/image_mono" />
<remap from="left_camera" to="$(arg stereo)/left" />
<remap from="right" to="$(arg stereo)/right/image_mono" />
<remap from="right_camera" to="$(arg stereo)/right" />
</node>
</launch>
<arg name="stereo" default="stereo"/>
<node pkg="camera_calibration" type="cameracalibrator.py" name="camera_calibrator" args="-k 6 --size 8x6 --square=0.04" output="screen">
<remap from="left" to="$(arg stereo)/left/image_mono" />
<remap from="left_camera" to="$(arg stereo)/left" />
<remap from="right" to="$(arg stereo)/right/image_mono" />
<remap from="right_camera" to="$(arg stereo)/right" />
</node>
</launch>
Loading