blob: 819ec64e34c9fd32882309dc61422ed5020eefdc [file] [log] [blame]
Brian Silvermanf7f267a2017-02-04 16:16:08 -08001/*----------------------------------------------------------------------------*/
2/* Copyright (c) FIRST 2014-2017. All Rights Reserved. */
3/* Open Source Software - may be modified and shared by FRC teams. The code */
4/* must be accompanied by the FIRST BSD license file in the root directory of */
5/* the project. */
6/*----------------------------------------------------------------------------*/
7
8#pragma once
9
10#include <string>
11
12#include <gazebo/transport/transport.hh>
13
14#include "SpeedController.h"
15
16#ifdef _WIN32
17// Ensure that Winsock2.h is included before Windows.h, which can get
18// pulled in by anybody (e.g., Boost).
19#include <Winsock2.h>
20#endif
21
22namespace frc {
23
24class SimContinuousOutput {
25 private:
26 gazebo::transport::PublisherPtr pub;
27 double speed;
28
29 public:
30 explicit SimContinuousOutput(std::string topic);
31
32 /**
33 * Set the output value.
34 *
35 * The value is set using a range of -1.0 to 1.0, appropriately
36 * scaling the value.
37 *
38 * @param value The value between -1.0 and 1.0 to set.
39 */
40 void Set(double value);
41
42 /**
43 * @return The most recently set value.
44 */
45 double Get();
46};
47
48} // namespace frc