80 auto set_state_callback =
86 uint16_t port,
bool isMulticast)
89 udp_com::UdpSocket socket_request;
91 socket_request.request.srcAddress = computer_addr;
92 socket_request.request.destAddress = camera_addr;
93 socket_request.request.port = port;
94 socket_request.request.isMulticast = isMulticast;
109 ROS_INFO(
"%s/ethernet_interface: %s",
145 ethernet_interface_handler.serviceClient<udp_com::UdpSocket>(
"udp/create_socket");
148 ethernet_interface_handler.serviceClient<udp_com::UdpSend>(
"udp/send");
150 ROS_INFO(
"Checking for UDP Communication...");
153 ROS_INFO(
"UDP Communication online");
158 ROS_WARN(
"Frame Socket not created");
164 ethernet_interface_handler.subscribe(std::string(
"udp/p") +
177 ethernet_interface_handler.subscribe(std::string(
"udp/p") +
184 ROS_WARN(
"Object Socket not created");
189 ethernet_interface_handler.subscribe(std::string(
"udp/p") +
196 ROS_WARN(
"Telemetry Socket not created");
201 ethernet_interface_handler.subscribe(std::string(
"udp/p") +
208 ROS_WARN(
"Slice Socket not created");
213 ethernet_interface_handler.subscribe(std::string(
"udp/p") +
224 std::string model, version, frame_id;
240 if (model ==
"hfl110dcu")
258 std::vector<uint8_t> start_command =
280 std::make_shared<dynamic_reconfigure::Server<hfl_driver::HFLConfig> >(
283 dynamic_reconfigure::Server<hfl_driver::HFLConfig>::CallbackType
284 dynamic_parameters_callback =
375 ROS_INFO_ONCE(
"Connection established with Frame Data UDP Port!");
381 flash_->processFrameData(udp_packet.data);
395 ROS_INFO_ONCE(
"Connection established with PDM Data UDP Port!");
415 ROS_INFO_ONCE(
"Connection established with Object Data UDP Port!");
421 flash_->processObjectData(udp_packet.data);
435 ROS_INFO_ONCE(
"Connection established with Telemetry Data UDP Port!");
441 flash_->processTelemetryData(udp_packet.data);
455 ROS_INFO_ONCE(
"Connection established with Slice Data UDP Port!");
461 flash_->processSliceData(udp_packet.data);
470 udp_com::UdpSend send_request;
475 send_request.request.data = data;
481 return send_request.response.sent;
482 }
else if (!send_request.response.socketCreated) {
488 ROS_ERROR(
"Could not send data to sensor");
489 ROS_INFO(
"Please check the connections to the sensor. ");
504 if (
flash_->setGlobalRangeOffset(config.global_range_offset))
505 ROS_INFO(
"%s/global_range_offset: %f",
namespace_.c_str(), config.global_range_offset);
ros::NodeHandle node_handler_
Node Handle.
This file defines the HFL110DCU image processor class.
ros::Subscriber tele_data_subscriber_
UDP Telemetry Data Subscriber.
void teleDataCallback(const udp_com::UdpPacket &udp_packet)
PLUGINLIB_EXPORT_CLASS(udp_com::UdpComNodelet, nodelet::Nodelet)
void objectDataCallback(const udp_com::UdpPacket &udp_packet)
error_codes checkForError()
#define ROS_INFO_ONCE(...)
This file defines the CameraCommander class.
error_codes error_status_
Error Status.
bool call(MReq &req, MRes &res)
ros::Subscriber object_data_subscriber_
UDP Object Data Subscriber.
void pdmDataCallback(const udp_com::UdpPacket &udp_packet)
std::string namespace_
Namespace.
ros::Timer timer_
Status checker timer.
ros::Subscriber frame_data_subscriber_
UDP Frame Data subscriber.
ros::NodeHandle & getPrivateNodeHandle() const
ros::Subscriber slice_data_subscriber_
UDP Slice Data Subscriber.
int frame_data_port_
Frame Data UDP port.
Implements the HFL110DCU camera image parsing and publishing.
uint32_t getNumPublishers() const
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
int slice_data_port_
Slice Data UDP port.
const std::string & getNamespace() const
void sliceDataCallback(const udp_com::UdpPacket &udp_packet)
bool sendCommand(const std::vector< uint8_t > &data)
int tele_data_port_
Telemetry Data UDP port.
commander_states previous_state_
Commander Previous state prior to error.
bool fixError(error_codes error)
void frameDataCallback(const udp_com::UdpPacket &udp_packet)
commander_states current_state_
Commander current state.
std::string camera_address_
IP Address of sensor.
ros::Subscriber pdm_data_subscriber_
UDP PDM Data Subscriber.
std::string ethernet_interface_
Ethernet Interface.
std::shared_ptr< dynamic_reconfigure::Server< hfl_driver::HFLConfig > > dynamic_parameters_server_
Dynamic Reconfigure server.
int pdm_data_port_
PDM Data UDP port.
bool getParam(const std::string &key, std::string &s) const
bool createSocket(std::string computerAddr, std::string cameraAddr, uint16_t port, bool isMulticast)
std::string computer_address_
IP Address of computer.
ros::ServiceClient udp_socket_creation_service_client_
UDP socket service client.
void setCommanderState(const ros::TimerEvent &timer_event)
ROSCPP_DECL bool exists(const std::string &service_name, bool print_failure_reason)
ros::ServiceClient udp_send_service_client_
UDP send service client.
int object_data_port_
Object Data UDP port.
ROSCPP_DECL bool waitForService(const std::string &service_name, int32_t timeout)
void dynamicPametersCallback(hfl_driver::HFLConfig &config, uint32_t level)
std::shared_ptr< hfl::HflInterface > flash_
Pointer to Flash camera.
Implements the camera configuration and setup.