14#include <units/frequency.h>
15#include <units/time.h>
31 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override
33 if (req.get() !=
this)
35 auto const reqCast =
dynamic_cast<Follower *
>(req.get());
36 if (reqCast !=
nullptr)
42 req = std::make_shared<Follower>(*
this);
159 std::stringstream ss;
160 ss <<
"Control: Follower" << std::endl;
161 ss <<
" MasterID: " <<
MasterID <<
" id" << std::endl;
173 std::map<std::string, std::string> controlInfo;
174 std::stringstream ss;
175 controlInfo[
"Name"] =
GetName();
176 ss <<
MasterID; controlInfo[
"MasterID"] = ss.str(); ss.str(std::string{});
CTREXPORT int c_ctre_phoenix6_RequestControlFollower(const char *canbus, uint32_t ecuEncoding, double updateTime, int MasterID, bool OpposeMasterDirection)
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:29
std::string const & GetName() const
Definition ControlRequest.hpp:52
Follow the motor output of another Talon.
Definition Follower.hpp:30
Follower & WithMasterID(int newMasterID)
Modifies this Control Request's MasterID parameter and returns itself for method-chaining and easier ...
Definition Follower.hpp:109
std::string ToString() const override
Returns a string representation of the object.
Definition Follower.hpp:157
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition Follower.hpp:171
Follower & WithOpposeMasterDirection(bool newOpposeMasterDirection)
Modifies this Control Request's OpposeMasterDirection parameter and returns itself for method-chainin...
Definition Follower.hpp:128
bool OpposeMasterDirection
Set to false for motor invert to match the master's configured Invert.
Definition Follower.hpp:61
Follower(int MasterID, bool OpposeMasterDirection)
Follow the motor output of another Talon.
Definition Follower.hpp:95
Follower & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition Follower.hpp:147
units::frequency::hertz_t UpdateFreqHz
The period at which this control will update at.
Definition Follower.hpp:74
int MasterID
Device ID of the master to follow.
Definition Follower.hpp:53
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition StatusCodes.h:18