Go to the documentation of this file.
66 uint8_t& out_prio, uint8_t& out_pdu_format, uint8_t& out_pdu_spec,
67 uint8_t& out_src_address, uint8_t& out_data_length, uint16_t& out_pgn,
68 std::vector<uint8_t>& out_data, std::vector<char>& out_raw_frame);
81 bool waitACK(uint16_t timeout_ms);
82 bool waitForVersion(uint16_t timeout,
bool printOutVersion =
false);
86 const uint8_t*
cmd,
const uint16_t cmd_len,
bool wait =
true);
111 const std::string& iniSection)
override;
157 bool& outThereIsObservation,
159 bool& hardwareError);
unsigned int m_nTries_current
bool getCANReaderTimeStamping()
bool tryToOpenComms(std::string *err_msg=nullptr)
Tries to open the com port and setup all the LMS protocol.
void setCANReaderSpeed(const unsigned int speed)
Sets the CAN reader speed when connecting to the CAN Bus.
mrpt::comms::CSerialPort * m_mySerialPort
Will be !=nullptr only if I created it, so I must destroy it at the end.
void initialize() override
Set-up communication with the laser.
uint8_t m_received_frame_buffer[2000]
void setSerialPort(const std::string &port)
Changes the serial port to connect to (call prior to 'doProcess'), for example "COM1" or "ttyS0".
unsigned int getCurrentConnectTry() const
If performing several tries in initialize(), this is the current try loop number.
void doProcess() override
This method will be invoked at a minimum rate of "process_rate" (Hz)
std::string m_com_port
If set to non-empty, the serial port will be attempted to be opened automatically when this class is ...
A communications serial port built as an implementation of a utils::CStream.
Contains classes for various device interfaces.
~CCANBusReader() override
Destructor
bool sendCommandToCANReader(const uint8_t *cmd, const uint16_t cmd_len, bool wait=true)
#define DEFINE_GENERIC_SENSOR(class_name)
This declaration must be inserted in all CGenericSensor classes definition, within the class declarat...
bool m_CANBusChannel_isOpen
unsigned int m_nTries_connect
Default = 1.
void loadConfig_sensorSpecific(const mrpt::config::CConfigFileBase &configSource, const std::string &iniSection) override
See the class documentation at the top for expected parameters.
int m_com_baudRate
Baudrate: 9600, 38400, 500000.
unsigned int getCANReaderSpeed()
void setCANReaderTimeStamping(bool setTimestamp=false)
Enables/Disables the addition of a timestamp according to the arrival time to the converter (default=...
bool CANBusOpenChannel()
Opens the CAN Channel.
bool m_canreader_timestamp
CCANBusReader()
Constructor
bool waitACK(uint16_t timeout_ms)
This class allows loading and storing values and vectors of different types from a configuration text...
bool waitContinuousSampleFrame(uint8_t &out_prio, uint8_t &out_pdu_format, uint8_t &out_pdu_spec, uint8_t &out_src_address, uint8_t &out_data_length, uint16_t &out_pgn, std::vector< uint8_t > &out_data, std::vector< char > &out_raw_frame)
bool queryVersion(bool printOutVersion=false)
TCLAP::CmdLine cmd("system_control_rate_timer_example")
This class stores a message from a CAN BUS with the protocol J1939.
A generic interface for a wide-variety of sensors designed to be used in the application RawLogGrabbe...
bool sendCANBusReaderSpeed()
Sends the specified speed to the CAN Converter.
Versatile class for consistent logging and management of output messages.
This "software driver" implements the communication protocol for interfacing a SICK LMS 2XX laser sca...
void doProcessSimple(bool &outThereIsObservation, mrpt::obs::CObservationCANBusJ1939 &outObservation, bool &hardwareError)
Specific laser scanner "software drivers" must process here new data from the I/O stream,...
bool waitIncomingFrame(uint16_t timeout)
bool CANBusCloseChannel()
Closes the CAN Channel.
void setBaudRate(int baud)
Changes the serial port baud rate (call prior to 'doProcess'); valid values are 9600,...
bool waitForVersion(uint16_t timeout, bool printOutVersion=false)
std::string getSerialPort() const
Page generated by Doxygen 1.8.17 for MRPT 2.0.4 at Sun Jul 19 15:15:43 UTC 2020 | |