56 #ifndef __SIM_LOC_COLA_TRANSMITTER_H_INCLUDED 57 #define __SIM_LOC_COLA_TRANSMITTER_H_INCLUDED 78 ColaTransmitter(
const std::string & server_adress =
"192.168.0.1",
int tcp_port = 2111,
double default_receive_timeout = 1);
95 virtual bool close(
void);
103 virtual bool send(
const std::vector<uint8_t> &
data, ROS::Time & send_timestamp);
112 static bool send(boost::asio::ip::tcp::socket & socket,
const std::vector<uint8_t> & data, ROS::Time & send_timestamp);
121 virtual bool receive(std::vector<uint8_t> & telegram,
double timeout, ROS::Time & receive_timestamp);
131 static bool receive(boost::asio::ip::tcp::socket & socket, std::vector<uint8_t> & telegram,
double timeout,ROS::Time & receive_timestamp);
156 virtual bool waitPopResponse(std::vector<uint8_t> & telegram,
double timeout, ROS::Time & receive_timestamp);
179 static bool dataEndWithETX(
const std::vector<uint8_t> & data,
const std::vector<uint8_t> & etx);
202 #endif // __SIM_LOC_COLA_TRANSMITTER_H_INCLUDED virtual ~ColaTransmitter()
sick_scan::ClientSocket m_tcp_socket
tcp socket connected to the localization controller
int m_tcp_port
tcp port of the localization controller, default: 2111 for command requests and 2112 for command resp...
bool m_receiver_thread_running
true: m_receiver_thread is running, otherwise false
std::string m_server_adress
ip adress of the localization controller, default: 192.168.0.1
virtual bool connect(void)
virtual bool startReceiverThread(void)
virtual bool stopReceiverThread(void)
double m_receive_timeout
default timeout in seconds for receive functions
boost::asio::io_service m_ioservice
boost io service for tcp connections
static bool dataEndWithETX(const std::vector< uint8_t > &data, const std::vector< uint8_t > &etx)
ColaResponseContainer(const std::vector< uint8_t > &data=std::vector< uint8_t >(), const ROS::Time ×tamp=ROS::now())
Constructor.
void runReceiverThreadCb(void)
boost::thread * m_receiver_thread
thread to receive responses from localization server
virtual bool send(const std::vector< uint8_t > &data, ROS::Time &send_timestamp)
ColaTransmitter(const std::string &server_adress="192.168.0.1", int tcp_port=2111, double default_receive_timeout=1)
ROS::Time receive_timestamp
receive timestamp in seconds (ros timestamp immediately after first response byte received) ...
sick_scan::FifoBuffer< ColaResponseContainer, boost::mutex > m_response_fifo
fifo buffer for receiver thread for responses from localization server
virtual bool receive(std::vector< uint8_t > &telegram, double timeout, ROS::Time &receive_timestamp)
std::vector< uint8_t > telegram_data
received telegram_data (Cola-Ascii or Cola-Binary)
virtual bool waitPopResponse(std::vector< uint8_t > &telegram, double timeout, ROS::Time &receive_timestamp)