Goby3  3.1.5a
2024.05.23
moos_ufield_sim_driver.h
Go to the documentation of this file.
1 // Copyright 2011-2021:
2 // GobySoft, LLC (2013-)
3 // Massachusetts Institute of Technology (2007-2014)
4 // Community contributors (see AUTHORS file)
5 // File authors:
6 // Toby Schneider <toby@gobysoft.org>
7 //
8 //
9 // This file is part of the Goby Underwater Autonomy Project Libraries
10 // ("The Goby Libraries").
11 //
12 // The Goby Libraries are free software: you can redistribute them and/or modify
13 // them under the terms of the GNU Lesser General Public License as published by
14 // the Free Software Foundation, either version 2.1 of the License, or
15 // (at your option) any later version.
16 //
17 // The Goby Libraries are distributed in the hope that they will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU Lesser General Public License for more details.
21 //
22 // You should have received a copy of the GNU Lesser General Public License
23 // along with Goby. If not, see <http://www.gnu.org/licenses/>.
24 
25 #ifndef GOBY_MOOS_MOOS_UFIELD_SIM_DRIVER_H
26 #define GOBY_MOOS_MOOS_UFIELD_SIM_DRIVER_H
27 
28 #include <MOOS/libMOOS/Comms/MOOSCommClient.h> // for CMOOSCommClient
29 
30 #include "goby/acomms/modemdriver/driver_base.h" // for ModemDriverBase
31 #include "goby/acomms/protobuf/driver_base.pb.h" // for DriverConfig
32 #include "goby/moos/modem_id_convert.h" // for ModemIdConvert
33 #include "goby/moos/protobuf/ufield_sim_driver.pb.h" // for Config
34 
35 namespace goby
36 {
37 namespace acomms
38 {
39 namespace protobuf
40 {
41 class ModemTransmission;
42 } // namespace protobuf
43 } // namespace acomms
44 
45 namespace moos
46 {
51 {
52  public:
53  UFldDriver();
54  void startup(const goby::acomms::protobuf::DriverConfig& cfg) override;
55  void shutdown() override;
56  void do_work() override;
58 
59  private:
60  void send_message(const goby::acomms::protobuf::ModemTransmission& msg);
61  void receive_message(const goby::acomms::protobuf::ModemTransmission& msg);
62 
63  // MicroModem special feature mimics
65 
66  private:
67  enum
68  {
69  DEFAULT_PACKET_SIZE = 64
70  };
71  enum
72  {
73  NOMINAL_SPEED_OF_SOUND = 1500
74  };
75  CMOOSCommClient moos_client_;
76  goby::acomms::protobuf::DriverConfig driver_cfg_; // configuration given to you at launch
77  goby::moos::ufld::protobuf::Config ufld_driver_cfg_;
78 
79  //boost::bimap<int, std::string> modem_id2name_;
80  goby::moos::ModemIdConvert modem_lookup_;
81 
82  int last_ccmpc_dest_{-1};
83 };
84 } // namespace moos
85 } // namespace goby
86 
87 #endif
goby::acomms::protobuf::DriverConfig
Definition: driver_base.pb.h:123
goby::moos::UFldDriver::UFldDriver
UFldDriver()
goby::acomms::protobuf::ModemTransmission
Definition: modem_message.pb.h:166
goby
The global namespace for the Goby project.
Definition: acomms_constants.h:33
ufield_sim_driver.pb.h
driver_base.h
goby::moos::UFldDriver::startup
void startup(const goby::acomms::protobuf::DriverConfig &cfg) override
Starts the modem driver. Must be called before poll().
driver_base.pb.h
goby::moos::ufld::protobuf::Config
Definition: ufield_sim_driver.pb.h:252
goby::msg
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions, ::google::protobuf::internal::MessageTypeTraits< ::goby::GobyMessageOptions >, 11, false > msg
Definition: option_extensions.pb.h:1327
goby::moos::UFldDriver::handle_initiate_transmission
void handle_initiate_transmission(const goby::acomms::protobuf::ModemTransmission &m) override
Virtual initiate_transmission method. Typically connected to MACManager::signal_initiate_transmission...
goby::acomms::ModemDriverBase
provides an abstract base class for acoustic modem drivers. This is subclassed by the various drivers...
Definition: driver_base.h:58
goby::moos::UFldDriver::do_work
void do_work() override
Allows the modem driver to do its work.
goby::moos::ModemIdConvert
Definition: modem_id_convert.h:36
goby::moos::UFldDriver
provides an simulator driver to the uFldNodeComms MOOS module: http://oceanai.mit....
Definition: moos_ufield_sim_driver.h:50
goby::moos::UFldDriver::shutdown
void shutdown() override
Shuts down the modem driver.
modem_id_convert.h