camera_commander.h
Go to the documentation of this file.
1 // Copyright 2020 Continental AG
2 // All rights reserved.
3 //
4 // Software License Agreement (BSD 2-Clause Simplified License)
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions
8 // are met:
9 //
10 // * Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 // * Redistributions in binary form must reproduce the above
13 // copyright notice, this list of conditions and the following
14 // disclaimer in the documentation and/or other materials provided
15 // with the distribution.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 // COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 // POSSIBILITY OF SUCH DAMAGE.
29 
30 
36 #ifndef CAMERA_COMMANDER__CAMERA_COMMANDER_H_
37 #define CAMERA_COMMANDER__CAMERA_COMMANDER_H_
38 
39 #include <hfl_driver/HFLConfig.h>
40 #include <hfl_interface.h>
41 
42 #include <dynamic_reconfigure/server.h>
43 #include <nodelet/nodelet.h>
44 
45 #include <vector>
46 #include <string>
47 #include <memory>
48 
49 #include "udp_com/UdpPacket.h"
50 #include "udp_com/UdpSend.h"
51 #include "udp_com/UdpSocket.h"
52 
53 #include "ros/ros.h"
54 
55 namespace hfl
56 {
59 {
64 };
65 
68 {
69  no_error = 0,
75 };
76 
81 {
82 public:
87 
92 
98  void onInit();
99 
105  bool udpInit();
106 
116  bool createSocket(std::string computerAddr, std::string cameraAddr,
117  uint16_t port, bool isMulticast);
118 
119 private:
122 
124  std::string namespace_;
125 
128 
131 
134 
137 
140 
143 
146 
148  std::shared_ptr<dynamic_reconfigure::Server<hfl_driver::HFLConfig> > dynamic_parameters_server_;
149 
152 
155 
158 
161 
163  std::string ethernet_interface_;
164 
166  std::string camera_address_;
167 
169  std::string computer_address_;
170 
173 
176 
179 
182 
185 
187  std::shared_ptr<hfl::HflInterface> flash_;
188 
196  void setCommanderState(const ros::TimerEvent& timer_event);
197 
204  bool setFlash();
205 
216  void frameDataCallback(const udp_com::UdpPacket& udp_packet);
217 
228  void pdmDataCallback(const udp_com::UdpPacket& udp_packet);
229 
240  void objectDataCallback(const udp_com::UdpPacket& udp_packet);
241 
252  void teleDataCallback(const udp_com::UdpPacket& udp_packet);
253 
264  void sliceDataCallback(const udp_com::UdpPacket& udp_packet);
265 
274  bool sendCommand(const std::vector<uint8_t>& data);
275 
285  void dynamicPametersCallback(hfl_driver::HFLConfig& config, uint32_t level);
286 
291 
297 
298  bool fixError(error_codes error);
299 };
300 
301 } // namespace hfl
302 
303 #endif // CAMERA_COMMANDER__CAMERA_COMMANDER_H_
ros::NodeHandle node_handler_
Node Handle.
ros::Subscriber tele_data_subscriber_
UDP Telemetry Data Subscriber.
void teleDataCallback(const udp_com::UdpPacket &udp_packet)
void objectDataCallback(const udp_com::UdpPacket &udp_packet)
error_codes error_status_
Error Status.
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.
This file defines the HFL camera&#39;s interface class.
commander_states
Commander states enum.
ros::Subscriber slice_data_subscriber_
UDP Slice Data Subscriber.
int frame_data_port_
Frame Data UDP port.
int slice_data_port_
Slice Data UDP port.
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 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)
ros::ServiceClient udp_send_service_client_
UDP send service client.
int object_data_port_
Object Data UDP port.
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.
error_codes
Error Codes.


hfl_driver
Author(s): Evan Flynn , Maxton Ginier , Gerardo Bravo , Moises Diaz
autogenerated on Sat Mar 20 2021 02:27:31