Go to the documentation of this file.
42 #ifndef SICK_SCAN_COMMON_H_
43 #define SICK_SCAN_COMMON_H_
51 #include <boost/asio.hpp>
54 #include <sensor_msgs/LaserScan.h>
55 #include <sensor_msgs/PointCloud.h>
56 #include <sensor_msgs/PointCloud2.h>
57 #include <std_msgs/String.h>
69 #include <dynamic_reconfigure/server.h>
70 #include <sick_scan/SickScanConfig.h>
77 #include "sick_scan/Encoder.h"
176 #define PARAM_MIN_ANG "min_ang"
177 #define PARAM_MAX_ANG "max_ang"
178 #define PARAM_RES_ANG "res_ang"
231 void update_config(sick_scan::SickScanConfig &new_config, uint32_t level = 0);
298 virtual int sendSOPASCommand(
const char *request, std::vector<unsigned char> *reply,
int cmdLen = -1) = 0;
307 virtual int get_datagram(
ros::Time &recvTimeStamp,
unsigned char *receiveBuffer,
int bufferSize,
int *actual_length,
308 bool isBinaryProtocol,
int *numberOfRemainingFifoEntries) = 0;
315 std::string
replyToString(
const std::vector<unsigned char> &reply);
383 bool setNewIpAddress(boost::asio::ip::address_v4 ipNewIPAddr,
bool useBinaryCmd);
bool isCompatibleDevice(const std::string identStr) const
check the identification string
@ CMD_SET_ENCODER_MODE_DL
std::mutex sopasSendMutex
@ CMD_APPLICATION_MODE_FIELD_OFF
virtual int init_scanner()
initialize scanner
@ CMD_ACTIVATE_NTP_CLIENT
bool changeIPandreboot(boost::asio::ip::address_v4 IpAdress)
Send a SOPAS command to the scanner that logs in the authorized client, changes the ip adress and the...
void setProtocolType(SopasProtocol cola_dialect_id)
set protocol type as enum
ros::Publisher lferec_pub_
int getReadTimeOutInMs()
get timeout in milliseconds
void swap_endian(unsigned char *ptr, int numBytes)
Universal swapping function.
@ CMD_SET_ENCODER_MODE_SI
ros::Publisher Encoder_pub
@ CMD_LOAD_APPLICATION_DEFAULT
bool dumpDatagramForDebugging(unsigned char *buffer, int bufLen)
@ CMD_APPLICATION_MODE_FIELD_ON
int setApplicationMode(bool _active, int _mode)
@ CMD_GET_SAFTY_FIELD_CFG
std::vector< std::vector< unsigned char > > sopasReplyBinVec
bool testsetAligmentMode()
bool testsetActivateStandBy()
@ CMD_SET_TRANSMIT_OBJECTS_OFF
virtual int init_device()=0
virtual int sendSOPASCommand(const char *request, std::vector< unsigned char > *reply, int cmdLen=-1)=0
Send a SOPAS command to the device and print out the response to the console.
int ActivateStandBy(void)
void check_angle_range(SickScanConfig &conf)
check angle setting in the config and adjust the min_ang to the max_ang if min_ang greater than max_a...
SickScanCommon(SickGenericParser *parser)
Construction of SickScanCommon.
AngleCompensator * angleCompensator
@ CMD_GET_PARTIAL_SCAN_CFG
@ CMD_SET_ACCESS_MODE_3_SAFETY_SCANNER
SickScanConfig * getConfigPtr()
bool testSettingIpAddress()
@ CMD_SET_NTP_SERVER_IP_ADDR
dynamic_reconfigure::Server< sick_scan::SickScanConfig > dynamic_reconfigure_server_
@ CMD_SET_TRANSMIT_OBJECTS_ON
double get_expected_frequency() const
@ CMD_SET_PARTICLE_FILTER
double expectedFrequency_
@ CMD_SET_PARTIAL_SCANDATA_CFG
bool checkForProtocolChangeAndMaybeReconnect(bool &useBinaryCmdNow)
checks the current protocol type and gives information about necessary change
virtual bool rebootScanner()
Send a SOPAS command to the scanner that should cause a soft reset.
int getProtocolType(void)
get protocol type as enum
@ CMD_SET_PARTIAL_SCAN_CFG
bool setNTPServerAndStart(boost::asio::ip::address_v4 ipNewIPAddr, bool useBinaryCmd)
SickScanMarker * cloud_marker_
@ CMD_SET_ENCODER_MODE_NO
bool setNewIpAddress(boost::asio::ip::address_v4 ipNewIPAddr, bool useBinaryCmd)
SopasProtocol m_protocolId
@ CMD_GET_PARTIAL_SCANDATA_CFG
@ CMD_SET_OUTPUT_RANGES_NAV3
std::vector< int > sopasCmdChain
int convertAscii2BinaryCmd(const char *requestAscii, std::vector< unsigned char > *requestBinary)
Convert ASCII-message to Binary-message.
ros::Publisher imuScan_pub_
virtual int stop_scanner()
Stops sending scan data.
int checkForBinaryAnswer(const std::vector< unsigned char > *reply)
Check block for correct framing and starting sequence of a binary message.
@ CMD_SET_ENCODER_MODE_DP
@ CMD_SET_TO_COLA_A_PROTOCOL
bool getSensorIsRadar(void)
@ CMD_SET_NTP_INTERFACE_ETH
@ CMD_SET_SCANDATACONFIGNAV
int sendSopasAndCheckAnswer(std::string request, std::vector< unsigned char > *reply, int cmdId)
send command and check answer
sensor_msgs::PointCloud2 cloud_
@ CMD_APPLICATION_MODE_RANGING_ON
bool testsetApplicationMode()
std::string sopasReplyToString(const std::vector< unsigned char > &reply)
Converts reply from sendSOPASCommand to string.
bool testsetParticleFilter()
@ CMD_SET_TRANSMIT_RAWTARGETS_OFF
ros::Publisher datagram_pub_
@ CMD_SET_TO_COLA_B_PROTOCOL
virtual int close_device()=0
std::vector< std::string > sopasCmdVec
@ CMD_GET_ANGLE_COMPENSATION_PARAM
int loopOnce()
parsing datagram and publishing ros messages
unsigned long convertBigEndianCharArrayToUnsignedLong(const unsigned char *vecArr)
Convert little endian to big endian (should be replaced by swap-routine)
diagnostic_updater::Updater diagnostics_
int setParticleFilter(bool _active, int _particleThreshold)
std::vector< std::string > sopasReplyVec
ros::Publisher cloud_pub_
virtual int get_datagram(ros::Time &recvTimeStamp, unsigned char *receiveBuffer, int bufferSize, int *actual_length, bool isBinaryProtocol, int *numberOfRemainingFifoEntries)=0
Read a datagram from the device.
@ CMD_SET_LID_OUTPUTSTATE_ACTIVE
void update_config(sick_scan::SickScanConfig &new_config, uint32_t level=0)
updating configuration
@ CMD_DEVICE_IDENT_LEGACY
@ CMD_SET_LID_INPUTSTATE_ACTIVE
virtual ~SickScanCommon()
Destructor of SickScanCommon.
@ CMD_SET_TRANSMIT_RAWTARGETS_ON
ros::Publisher lidoutputstate_pub_
diagnostic_updater::DiagnosedPublisher< sensor_msgs::LaserScan > * diagnosticPub_
virtual int init()
init routine of scanner
@ CMD_SET_INCREMENTSOURCE_ENC
@ CMD_SET_TRACKING_MODE_1
void setReadTimeOutInMs(int timeOutInMs)
set timeout in milliseconds
@ CMD_SET_TRACKING_MODE_0
std::vector< std::string > sopasCmdErrMsg
std::string replyToString(const std::vector< unsigned char > &reply)
Converts reply from sendSOPASCommand to string.
SickGenericParser * parser_
int init_cmdTables()
init command tables and define startup sequence
std::vector< std::string > sopasCmdMaskVec
int setAligmentMode(int _AligmentMode)
bool publish_lidoutputstate_
std::vector< std::string > sopasReplyStrVec
std::string generateExpectedAnswerString(const std::vector< unsigned char > requestStr)
Generate expected answer string from the command string.
int setMeanFilter(bool _active, int _numberOfScans)
void setSensorIsRadar(bool _isRadar)
sick_scan
Author(s): Michael Lehning
, Jochen Sprickerhof , Martin Günther
autogenerated on Thu Sep 8 2022 02:30:19