Public Member Functions | Private Attributes | List of all members
udp_com::UdpCom Class Reference

Implements the UDP methods for recieving and sending within the ROS ecosystem. More...

#include <udp_com.h>

Public Member Functions

void doReceive ()
 
std::string getIp ()
 Returns the src IP for the created socket. More...
 
size_t send (const std::vector< u_char > &data, const std::string &ip_address, const uint16_t udp_port)
 
 UdpCom (std::string computer_address, std::string sensor_address, uint16_t port, bool is_multicast, ros::Publisher publisher)
 
 ~UdpCom ()
 

Private Attributes

std::string computer_address_
 Source (computer) IP Address. More...
 
boost::asio::io_service io_service_
 UDP IO service. More...
 
udp::endpoint receiver_endpoint_
 UDP endpoint receiver. More...
 
udp::endpoint sender_endpoint_
 UDP endpoint sender. More...
 
udp::socket socket_
 UDP socket. More...
 
boost::thread thread_
 Thread for service. More...
 
UdpPacket udp_packet_
 UDP packet to be sent. More...
 
ros::Publisher udp_packet_publisher_
 ROS publisher. More...
 

Detailed Description

Implements the UDP methods for recieving and sending within the ROS ecosystem.

Definition at line 68 of file udp_com.h.

Constructor & Destructor Documentation

udp_com::UdpCom::UdpCom ( std::string  computer_address,
std::string  sensor_address,
uint16_t  port,
bool  is_multicast,
ros::Publisher  publisher 
)

Initializer constructor.

Parameters
[in]computer_addresscomputer ip address
[in]sensor_addresscamera ip address
[in]portcamera UDP port number
[in]is_multicastmulticast flag
[in]publisherROS publisher

Definition at line 18 of file udp_com.cpp.

udp_com::UdpCom::~UdpCom ( )

Destructor.

Definition at line 83 of file udp_com.cpp.

Member Function Documentation

void udp_com::UdpCom::doReceive ( )

Recieves and publishes the UDP data.

Formats the recieved UDP data and publishes it as a ROS message.

Returns
void

Definition at line 89 of file udp_com.cpp.

std::string udp_com::UdpCom::getIp ( )
inline

Returns the src IP for the created socket.

Definition at line 113 of file udp_com.h.

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.

Parameters
[in]dataThe data to be sent.
[in]ip_addressThe devide IP address.
[in]udp_portThe device port.
Returns
size_t the number of bytes sent

Definition at line 112 of file udp_com.cpp.

Member Data Documentation

std::string udp_com::UdpCom::computer_address_
private

Source (computer) IP Address.

Definition at line 141 of file udp_com.h.

boost::asio::io_service udp_com::UdpCom::io_service_
private

UDP IO service.

Definition at line 132 of file udp_com.h.

udp::endpoint udp_com::UdpCom::receiver_endpoint_
private

UDP endpoint receiver.

Definition at line 120 of file udp_com.h.

udp::endpoint udp_com::UdpCom::sender_endpoint_
private

UDP endpoint sender.

Definition at line 123 of file udp_com.h.

udp::socket udp_com::UdpCom::socket_
private

UDP socket.

Definition at line 135 of file udp_com.h.

boost::thread udp_com::UdpCom::thread_
private

Thread for service.

Definition at line 138 of file udp_com.h.

UdpPacket udp_com::UdpCom::udp_packet_
private

UDP packet to be sent.

Definition at line 129 of file udp_com.h.

ros::Publisher udp_com::UdpCom::udp_packet_publisher_
private

ROS publisher.

Definition at line 126 of file udp_com.h.


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


udp_com
Author(s): Hunter Laux , Max Ginier , Evan Flynn , Gerardo Bravo , Moises Diaz
autogenerated on Sat Dec 5 2020 04:01:00