2 #ifndef _GAMS_PLATFORM_OSCPLATFORM_H_
3 #define _GAMS_PLATFORM_OSCPLATFORM_H_
9 #include "madara/knowledge/KnowledgeBase.h"
10 #include "madara/utility/EpochEnforcer.h"
11 #include "madara/utility/Timer.h"
22 namespace gams {
namespace platforms
34 MOVEMENT_STOP_ON_ARRIVAL = 0,
35 MOVEMENT_PASSTHROUGH = 1
45 madara::knowledge::KnowledgeBase * knowledge = 0,
48 const std::string & type =
"quadcopter");
53 virtual ~OscPlatform();
59 virtual int sense(
void)
override;
65 virtual int analyze(
void)
override;
70 virtual std::string get_name()
const override;
78 virtual std::string get_id()
const override;
84 virtual double get_accuracy(
void)
const override;
90 virtual double get_min_sensor_range(
void)
const override;
96 virtual double get_move_speed(
void)
const override;
102 virtual int home(
void)
override;
108 virtual int land(
void)
override;
116 int move(
const pose::Position & location,
117 const pose::PositionBounds &bounds)
override;
128 const pose::OrientationBounds &bounds)
override;
135 virtual void pause_move(
void)
override;
141 virtual void set_move_speed(
const double& speed)
override;
147 virtual void stop_move(
void)
override;
153 virtual int takeoff(
void)
override;
164 void build_prefixes(
void);
174 std::vector<double> calculate_thrust(
175 const pose::Position & current,
const pose::Position & target,
179 gams::utility::OscUdp osc_;
182 madara::transport::QoSTransportSettings settings_;
185 std::string xy_velocity_prefix_;
188 std::string z_velocity_prefix_;
191 std::string yaw_velocity_prefix_;
194 std::string position_prefix_;
197 std::string rotation_prefix_;
200 bool is_created_ =
false;
203 std::string json_creation_;
206 pose::Position last_move_;
212 madara::utility::Timer<madara::utility::Clock> move_timer_;
215 madara::utility::Timer<madara::utility::Clock> last_thrust_timer_;
218 madara::utility::Timer<madara::utility::Clock> last_position_timer_;
224 double loiter_timeout_;
227 double respawn_timeout_;
234 class GAMS_EXPORT OscPlatformFactory :
public PlatformFactory
243 OscPlatformFactory(
const std::string & type =
"quadcopter");
248 virtual ~OscPlatformFactory();
264 virtual BasePlatform * create(
265 const madara::knowledge::KnowledgeMap & args,
266 madara::knowledge::KnowledgeBase * knowledge,
269 variables::Self *
self);
Copyright (c) 2019 James Edmondson.
Copyright(c) 2014 Carnegie Mellon University.
Copyright(c) 2014 Carnegie Mellon University.
Provides Reference Frame (i.e., coordinate systemm) transforms.
A container for self referencing information.
gams::pose::Orientation Orientation
Represents a orientation or orientation within a reference frame.
std::map< std::string, PlatformStatus > Platforms
a map of sensor names to the sensor information
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Contains all GAMS-related tools, classes and code.
Copyright (c) 2015 Carnegie Mellon University.