Visual Servoing Platform  version 3.6.1 under development (2024-03-28)
vpRingLight Class Reference

#include <visp3/robot/vpRingLight.h>

Public Member Functions

 vpRingLight ()
 
virtual ~vpRingLight ()
 
void pulse ()
 
void pulse (double time)
 
void on ()
 
void off ()
 

Detailed Description

Ring light management under unix.

Warning
This class works only at Irisa with the Edixia's ring light system.

Here is an example showing how to synchronise the framegrabbing with the lighting system.

#include <visp3/core/vpImage.h>
#include <visp3/robot/vpRingLight.h>
#include <visp3/sensor/vp1394TwoGrabber.h>
int main()
{
#if defined(VISP_HAVE_PARPORT) && defined(VISP_HAVE_DC1394)
vp1394TwoGrabber g; // Firewire framegrabber based on libdc1394-2.x third party lib
vpRingLight light; // Open the device to access to the ring light.
for (int i=0; i < 10; i++) {
light.pulse(); // Send a pulse to the lighting system
g.acquire(I); // Acquire an image
}
#endif
}
Class for firewire ieee1394 video devices using libdc1394-2.x api.
void acquire(vpImage< unsigned char > &I)
Ring light management under unix.
Definition: vpRingLight.h:106
void pulse()
Definition: vpRingLight.cpp:89

Here is an example showing how to turn on the lighting during 10 seconds.

#include <visp3/core/vpTime.h>
#include <visp3/robot/vpRingLight.h>
int main()
{
#ifdef VISP_HAVE_PARPORT
vpRingLight light; // Open the device to access to the ring light.
int nsec = 10; // Time to wait in seconds
light.on(); // Turn the ring light on
vpTime::wait(nsec * 1000); // Wait 10 s
light.off(); // and then turn the ring light off
#endif
}
VISP_EXPORT int wait(double t0, double t)
Examples
ringLight.cpp.

Definition at line 105 of file vpRingLight.h.

Constructor & Destructor Documentation

◆ vpRingLight()

vpRingLight::vpRingLight ( )

Constructor to access to the ring light device connected to the parallel port.

Open and initialise the default parallel port device "/dev/parport0" to communicate with the ring light.

Exceptions
vpParallelPortException::openingIf the device used to access to the parallel port can't be opened. A possible reason is that you don't have write access.

Turn the ring light off.

Definition at line 70 of file vpRingLight.cpp.

References off().

◆ ~vpRingLight()

vpRingLight::~vpRingLight ( )
virtual

Destructor to close the device.

Turn the ring light off.

Exceptions
vpParallelPortException::closingIf the device used to access to the parallel port can't be closed.

Definition at line 80 of file vpRingLight.cpp.

References off().

Member Function Documentation

◆ off()

void vpRingLight::off ( )

Turn the ring light off.

To turn the ring light on, see on().

Examples
ringLight.cpp.

Definition at line 196 of file vpRingLight.cpp.

References vpParallelPort::sendData().

Referenced by vpRingLight(), and ~vpRingLight().

◆ on()

void vpRingLight::on ( )

Turn the ring light on.

To turn the ring light off, see off().

Examples
ringLight.cpp.

Definition at line 170 of file vpRingLight.cpp.

References vpParallelPort::sendData().

◆ pulse() [1/2]

void vpRingLight::pulse ( )

Activates the ring light by sending a pulse throw the parallel port.

The pulse width is 500 us. This pulse activates a NE555 which turns on on the light during 10ms.

Examples
ringLight.cpp.

Definition at line 89 of file vpRingLight.cpp.

References vpParallelPort::sendData().

◆ pulse() [2/2]

void vpRingLight::pulse ( double  time)

Activates the ring light by sending a pulse throw the parallel port during a specified duration.

Parameters
time: Duration in milli-second (ms) during while the light is turned on.

Definition at line 132 of file vpRingLight.cpp.

References vpParallelPort::sendData().