Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SICK Visionary samples

Overview

This repository contains programming samples for Sick Visionary-T Mini CX (V3S105-1AAAAAA) and Sick Visionary-S CX (V3S102-1AAAAAA and V3S102-1AABAAB).

The entry point for our camera programming samples is the Python Welcome Demo and the Cpp Welcome Demo. These welcome demos provide an overview to the functionalities offered by the Visionary Python and C++ API. They cover aspects such as device connection, user authentication (login and logout), parameter adjustments, along with the streaming and storage of images and point clouds.

For new users we recommended to follow the samples in the following order:

License

The source code is released under The Unlicense.

Supported environments

The samples in this repository have been tested with the following platforms:

Platform Compiler Version Notes

Windows

Visual Studio / Build Tools

2022 (MSVC = 19.3x)

Windows

gcc (mingw64)

14.2.0 (>= 11.1)

Linux inside WSL2

gcc

11.4.0 (>= 11.1)

finding_and_connecting_devices (AutoIP) and image_streaming_and_storing (UDP) will not work with default WSL2 configuration (NAT)

Supported Hardware

device name part no. description firmware version

Visionary-T Mini CX (V3S105-1AAAAAA, V3S105-1AAAAAD)

1112649 1132065

3D time-of-flight camera

3.0.1 & 4.0.1 ✔

Visionary-S CX (V3S102-1AAAAAA, V3S102-1AABAAB)

1090184 1090185

3D structured light stereovision camera with RGB data

6.0.0 & 6.5.2 ✔

Getting started

Ensure you have a recent version of cmake [1] and a compiler available on your machine’s system. If you are working on windows with a recent version of VisualStudio[2], take care to have a CMake version supporting your version of Visual Studio.

After cloning this repository, open a Command Prompt window and navigate to sick_visionary_samples directory. Run these additional git commands to have the correct submodules in place [3]:

  • git submodule update --init --recursive

Python installation and usage

Most of the sample code (see more details below) is designed for use with Python 3.7 to Python 3.11 (code is tested with Python 3.8 and 3.10). Install Python from its official website. Python 3.8 is recommended and frequently tested, but it is not a strict requirement.

If another version is already installed, create an isolated virtual environment using python -m venv to ensure compatibility with the samples.

Linux one-command bootstrap

For Linux users, the repository provides a minimal bootstrap script that uses the system default python3, creates a virtual environment and installs Python requirements.

From the repository root directory:

chmod +x setup_linux_env.sh
./setup_linux_env.sh

Afterwards, activate the environment:

source .venv_sick_visionary_samples/bin/activate

Windows one-command bootstrap

For Windows users, the repository provides a PowerShell bootstrap script that locates py or python, creates a virtual environment and installs Python requirements.

From the repository root directory in a PowerShell terminal:

.\setup_windows_env.ps1

Afterwards, activate the environment:

.\.venv_sick_visionary_samples\Scripts\Activate.ps1
Sample how to set up a Python virtual environment

Any Python version in the supported range (3.7 - 3.11) can be used. The example below uses Python 3.10 (the default on Ubuntu 22.04), but the same steps apply to any compatible version.

Linux

# check the currently used Python version
$ python3 --version
Python 3.10.x

# create a virtual environment using the system default python3
$ python3 -m venv .venv_sick_visionary_samples

# activate the virtual environment
$ source .venv_sick_visionary_samples/bin/activate
(.venv_sick_visionary_samples) $ python --version
Python 3.10.x

# install the requirenments
(.venv_sick_visionary_samples) $ pip install -r requirements.txt

# To quit/exit the virtual environment
(.venv_sick_visionary_samples) $ deactivate
$

Windows

# check the currently used Python version
C:\projects\visionary_samples> python --version
Python 3.10.2

# create a virtual environment using the built-in venv module
C:\projects\visionary_samples> python -m venv .venv_sick_visionary_samples

# activate the virtual environment
C:\projects\visionary_samples> .venv_sick_visionary_samples\Scripts\activate
(.venv_sick_visionary_samples) C:\projects\visionary_samples> python --version
Python 3.10.2

# install the requirenments
(.venv_sick_visionary_samples) C:\projects\visionary_samples> pip install -r requirements.txt

# To quit/exit the virtual environment
(.venv_sick_visionary_samples) C:\projects\visionary_samples> deactivate
C:\projects\visionary_samples>

All required Python packages needed for working with the samples are defined in requirements.txt.

Note
requirements.txt also installs a local shared helper module from shared/python. Therefore, run the install command from the repository root directory.
Installation of requirements.txt fails?

If the installation fails with an error message similar to the following (message may vary depending on the package name):

ERROR: Could not find a version that satisfies the requirement genicam (from versions: none)
ERROR: No matching distribution found for genicam

In this case it is very likely that the package is not provided for your current Python version. This can happen when maintainers of packages need more time to adopt their package to new Python releases. To verify, go to https://pypi.org/ and search for the failing package. Navigate to "Download files" to see a full list of wheel packages. You can derive from the file name which Python versions are supported. Example: if the file name contains *-cp311-* that whl file is for Python version 3.11.
With this information you should be able to select the correct Python version to be installed and used in your virtualenv.

After activation, run the Python samples from the repository root. E.g. to run the Python Welcome demo, execute the following command from the top-level directory:

python visionary_welcome/python/capture.py -i 192.168.1.10 -d Visionary-S --mode stream --save_images --save_pointcloud --save_optimized_pointcloud

Depending on your environment, you may need to use python or python3. Make sure to adjust the IP address (-i) and device type (-d) to match your specific device.

The welcome demo supports the following command line options:

Argument Type Default Description

-i, --ipAddress

string

192.168.1.10

IP address of the Visionary device.

-d, --device_type

string

Visionary-S

Visionary product type. Choices: Visionary-S, Visionary-T Mini.

--mode

string

duration

Streaming mode. Choices:
stream — runs continuously until Ctrl+C.
frames — captures a fixed number of frames (see --num_frames).
duration — streams for a given number of seconds (see --duration).

--duration

float

10.0

Duration in seconds. Used with --mode duration.

--num_frames

int

10

Number of frames to capture. Used with --mode frames.

--save_pointcloud

flag

off

Save non-optimized point cloud as .ply per frame to VisionaryToPointCloud/.

--save_optimized_pointcloud

flag

off

Save optimized point cloud as .pcd per frame to VisionaryToPointCloud/.

--save_images

flag

off

Save depth/intensity/confidence maps as PNG per frame to VisionaryImages/.

To leave the virtual environment, run:

$ deactivate
Note

Replace the installation commands with the equivalent for your operating system or Python environment if necessary.

C++

To build the C++ samples, it is suggested to proceed like this [4]:

  • cmake -B build optionally also specify other options like -G for custom generator

Note

If you run into WARNING_AS_ERROR issue with some compiler (which is enabled per default) just use the cmake override --compile-no-warning-as-error when configuring the project.

Now you can build the files with the chosen build-system you’ve generated them for, for instance, open the solution in VisualStudio or run make/ninja.

  • cmake --build build

Note

To build base/cpp and shared/cpp as shared libraries, set the CMake variable BUILD_SHARED_LIBS to ON in the top-level CMakeLists.txt:

set(BUILD_SHARED_LIBS ON) // Enable building with shared libraries

When BUILD_SHARED_LIBS is enabled, it’s recommended to define the runtime output directory so that executables and shared libraries are placed together:

if (BUILD_SHARED_LIBS)
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/output)
endif()

This setup is especially important on Windows, where .exe and .dll files must reside in the same directory for proper execution.

To run the C++ welcome demo, follow these steps:

  1. Navigate to the output/ directory from the top-level directory:

$ cd build/output/
  1. Execute the welcome demo with the specified IP address and device:

$ ./welcome -i127.0.0.1 -dVisionary-S

Remember to adjust the IP address (-i) and device type (-d) to match your specific device.

Support

Depending on the nature of your question, there are two support channels:

  1. For questions regarding the code shared in this repo please check the FAQ first and search if an issue already exists. If a related issue doesn’t exist, you can open a new issue using the issue form.

  2. For application or device specific questions look for common solutions and knowledge articles on the Sick Support Portal. If your question is not answered there, open a ticket on the Sick Support Portal.

Keywords

Visionary-S Visionary-T Mini SICK CX


1. minimum required version >= 3.24
2. >= 2017, or buildtools with MSVC = 14.x
3. Only necessary if you have fetched the files from the GitHub repository. If you have received the samples in a prepared package, the git commands can be skipped.
4. Also, other ways are possible

About

publish open source samples (supplementary material)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages