udp_com
1.1.1
Provides a flexible ROS driver for working with UDP interfaces
|
Implements the UDP methods for recieving and sending within the ROS ecosystem. More...
#include <udp_com.h>
Public Member Functions | |
UdpCom (std::string computer_address, std::string sensor_address, uint16_t port, bool is_multicast, ros::Publisher publisher) | |
~UdpCom () | |
void | doReceive () |
size_t | send (const std::vector< u_char > &data, const std::string &ip_address, const uint16_t udp_port) |
std::string | getIp () |
Returns the src IP for the created socket. | |
Private Attributes | |
udp::endpoint | receiver_endpoint_ |
UDP endpoint receiver. | |
udp::endpoint | sender_endpoint_ |
UDP endpoint sender. | |
ros::Publisher | udp_packet_publisher_ |
ROS publisher. | |
UdpPacket | udp_packet_ |
UDP packet to be sent. | |
boost::asio::io_service | io_service_ |
UDP IO service. | |
udp::socket | socket_ |
UDP socket. | |
boost::thread | thread_ |
Thread for service. | |
std::string | computer_address_ |
Source (computer) IP Address. | |
Implements the UDP methods for recieving and sending within the ROS ecosystem.
udp_com::UdpCom::UdpCom | ( | std::string | computer_address, |
std::string | sensor_address, | ||
uint16_t | port, | ||
bool | is_multicast, | ||
ros::Publisher | publisher | ||
) |
Initializer constructor.
[in] | computer_address | computer ip address |
[in] | sensor_address | camera ip address |
[in] | port | camera UDP port number |
[in] | is_multicast | multicast flag |
[in] | publisher | ROS publisher |
udp_com::UdpCom::~UdpCom | ( | ) |
Destructor.
void udp_com::UdpCom::doReceive | ( | ) |
Recieves and publishes the UDP data.
Formats the recieved UDP data and publishes it as a ROS message.
size_t udp_com::UdpCom::send | ( | const std::vector< u_char > & | data, |
const std::string & | ip_address, | ||
const uint16_t | udp_port | ||
) |
Sends data through UDP protocol.
Service send function for UDP data sending.
[in] | data | The data to be sent. |
[in] | ip_address | The devide IP address. |
[in] | udp_port | The device port. |