Robotics Library  0.7.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
rl::hal::LeuzeRs4 Class Reference

Leuze RS4 safety laser scanner. More...

#include <LeuzeRs4.h>

Inheritance diagram for rl::hal::LeuzeRs4:
Inheritance graph
[legend]

Public Types

enum  BaudRate {
  BAUDRATE_4800BPS, BAUDRATE_9600BPS, BAUDRATE_19200BPS, BAUDRATE_38400BPS,
  BAUDRATE_57600BPS, BAUDRATE_115200BPS, BAUDRATE_345600BPS, BAUDRATE_625000BPS
}
 

Public Member Functions

 LeuzeRs4 (const ::std::string &device="/dev/ttyS0", const BaudRate &baudRate=BAUDRATE_57600BPS, const ::std::string &password="ROD4LE")
 
virtual ~LeuzeRs4 ()
 
void close ()
 
BaudRate getBaudRate () const
 
void getDistances (::rl::math::Vector &distances) const
 
::std::size_t getDistancesCount () const
 
::rl::math::Real getDistancesMaximum (const ::std::size_t &i) const
 
::rl::math::Real getDistancesMinimum (const ::std::size_t &i) const
 
::rl::math::Real getResolution () const
 
::rl::math::Real getStartAngle () const
 
::rl::math::Real getStopAngle () const
 
void open ()
 
void reset ()
 
void start ()
 
void step ()
 
void stop ()
 
- Public Member Functions inherited from rl::hal::CyclicDevice
 CyclicDevice (const ::std::chrono::nanoseconds &updateRate)
 
virtual ~CyclicDevice ()
 
virtual ::std::chrono::nanoseconds getUpdateRate () const
 
- Public Member Functions inherited from rl::hal::Device
 Device ()
 
virtual ~Device ()
 
bool isConnected () const
 
bool isRunning () const
 
- Public Member Functions inherited from rl::hal::Lidar
 Lidar ()
 
virtual ~Lidar ()
 
- Public Member Functions inherited from rl::hal::RangeSensor
 RangeSensor ()
 
virtual ~RangeSensor ()
 
virtual ::rl::math::Vector getDistances () const =0
 

Private Member Functions

::std::uint8_t crc (const ::std::uint8_t *buf, const ::std::size_t &len) const
 
const ::std::uint8_t & get (const ::std::uint8_t *&ptr) const
 
::std::size_t recv (uint8_t *buf, const ::std::size_t &len)
 
void send (uint8_t *buf, const ::std::size_t &len)
 
void set (const ::std::uint8_t &value, ::std::uint8_t *&ptr, ::std::size_t &len) const
 

Private Attributes

BaudRate baudRate
 
::std::array< ::std::uint8_t, 1099 > data
 
BaudRate desired
 
bool far1
 
bool far2
 
bool fn1Fn2
 
bool near1
 
bool near2
 
::std::string password
 
Serial serial
 
::std::uint16_t startIndex
 
::std::uint16_t stepSize
 
::std::uint16_t stopIndex
 
::std::uint16_t type
 

Additional Inherited Members

- Protected Member Functions inherited from rl::hal::Device
void setConnected (const bool &connected)
 
void setRunning (const bool &running)
 

Detailed Description

Leuze RS4 safety laser scanner.

Member Enumeration Documentation

◆ BaudRate

Enumerator
BAUDRATE_4800BPS 

4,800 bps.

BAUDRATE_9600BPS 

9,600 bps.

BAUDRATE_19200BPS 

19,200 bps.

BAUDRATE_38400BPS 

38,400 bps.

BAUDRATE_57600BPS 

57,600 bps.

BAUDRATE_115200BPS 

115,200 bps.

BAUDRATE_345600BPS 

345,600 bps.

BAUDRATE_625000BPS 

625,000 bps.

Constructor & Destructor Documentation

◆ LeuzeRs4()

rl::hal::LeuzeRs4::LeuzeRs4 ( const ::std::string &  device = "/dev/ttyS0",
const BaudRate baudRate = BAUDRATE_57600BPS,
const ::std::string &  password = "ROD4LE" 
)
Parameters
[in]passwordString with 8 characters.

◆ ~LeuzeRs4()

rl::hal::LeuzeRs4::~LeuzeRs4 ( )
virtual

Member Function Documentation

◆ close()

void rl::hal::LeuzeRs4::close ( )
virtual
Precondition
stop()

Implements rl::hal::Device.

◆ crc()

std::uint8_t rl::hal::LeuzeRs4::crc ( const ::std::uint8_t *  buf,
const ::std::size_t &  len 
) const
private

◆ get()

const ::std::uint8_t & rl::hal::LeuzeRs4::get ( const ::std::uint8_t *&  ptr) const
private

◆ getBaudRate()

LeuzeRs4::BaudRate rl::hal::LeuzeRs4::getBaudRate ( ) const

◆ getDistances()

void rl::hal::LeuzeRs4::getDistances ( ::rl::math::Vector distances) const

◆ getDistancesCount()

std::size_t rl::hal::LeuzeRs4::getDistancesCount ( ) const
virtual

Implements rl::hal::RangeSensor.

◆ getDistancesMaximum()

rl::math::Real rl::hal::LeuzeRs4::getDistancesMaximum ( const ::std::size_t &  i) const
virtual
Returns
[m]

Implements rl::hal::RangeSensor.

◆ getDistancesMinimum()

rl::math::Real rl::hal::LeuzeRs4::getDistancesMinimum ( const ::std::size_t &  i) const
virtual
Returns
[m]

Implements rl::hal::RangeSensor.

◆ getResolution()

rl::math::Real rl::hal::LeuzeRs4::getResolution ( ) const
virtual

Implements rl::hal::Lidar.

◆ getStartAngle()

rl::math::Real rl::hal::LeuzeRs4::getStartAngle ( ) const
virtual

Implements rl::hal::Lidar.

◆ getStopAngle()

rl::math::Real rl::hal::LeuzeRs4::getStopAngle ( ) const
virtual

Implements rl::hal::Lidar.

◆ open()

void rl::hal::LeuzeRs4::open ( )
virtual

Implements rl::hal::Device.

◆ recv()

std::size_t rl::hal::LeuzeRs4::recv ( uint8_t *  buf,
const ::std::size_t &  len 
)
private

◆ reset()

void rl::hal::LeuzeRs4::reset ( )

◆ send()

void rl::hal::LeuzeRs4::send ( uint8_t *  buf,
const ::std::size_t &  len 
)
private

◆ set()

void rl::hal::LeuzeRs4::set ( const ::std::uint8_t &  value,
::std::uint8_t *&  ptr,
::std::size_t &  len 
) const
private

◆ start()

void rl::hal::LeuzeRs4::start ( )
virtual
Precondition
open()

Implements rl::hal::Device.

◆ step()

void rl::hal::LeuzeRs4::step ( )
virtual
Precondition
start()

Implements rl::hal::CyclicDevice.

◆ stop()

void rl::hal::LeuzeRs4::stop ( )
virtual
Precondition
open()

Implements rl::hal::Device.

Member Data Documentation

◆ baudRate

BaudRate rl::hal::LeuzeRs4::baudRate
private

◆ data

::std::array< ::std::uint8_t, 1099> rl::hal::LeuzeRs4::data
private

◆ desired

BaudRate rl::hal::LeuzeRs4::desired
private

◆ far1

bool rl::hal::LeuzeRs4::far1
private

◆ far2

bool rl::hal::LeuzeRs4::far2
private

◆ fn1Fn2

bool rl::hal::LeuzeRs4::fn1Fn2
private

◆ near1

bool rl::hal::LeuzeRs4::near1
private

◆ near2

bool rl::hal::LeuzeRs4::near2
private

◆ password

::std::string rl::hal::LeuzeRs4::password
private

◆ serial

Serial rl::hal::LeuzeRs4::serial
private

◆ startIndex

::std::uint16_t rl::hal::LeuzeRs4::startIndex
private

◆ stepSize

::std::uint16_t rl::hal::LeuzeRs4::stepSize
private

◆ stopIndex

::std::uint16_t rl::hal::LeuzeRs4::stopIndex
private

◆ type

::std::uint16_t rl::hal::LeuzeRs4::type
private

The documentation for this class was generated from the following files: