14#include <units/frequency.h>
15#include <units/time.h>
31 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash,
bool cancelOtherRequests, std::shared_ptr<ControlRequest> &req)
override
33 if (req.get() !=
this)
36 if (reqCast !=
nullptr)
42 req = std::make_shared<DifferentialFollower>(*
this);
159 std::stringstream ss;
160 ss <<
"class: DifferentialFollower" << std::endl;
161 ss <<
"MasterID: " <<
MasterID << 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_RequestControlDifferentialFollower(const char *canbus, uint32_t ecuEncoding, double updateTime, bool cancelOtherRequests, int MasterID, bool OpposeMasterDirection)
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:28
std::string const & GetName() const
Definition: ControlRequest.hpp:51
Follow the differential motor output of another Talon.
Definition: DifferentialFollower.hpp:30
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition: DifferentialFollower.hpp:171
DifferentialFollower & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition: DifferentialFollower.hpp:147
units::frequency::hertz_t UpdateFreqHz
The period at which this control will update at.
Definition: DifferentialFollower.hpp:74
DifferentialFollower & WithOpposeMasterDirection(bool newOpposeMasterDirection)
Modifies this Control Request's OpposeMasterDirection parameter and returns itself for method-chainin...
Definition: DifferentialFollower.hpp:128
DifferentialFollower(int MasterID, bool OpposeMasterDirection)
Follow the differential motor output of another Talon.
Definition: DifferentialFollower.hpp:95
DifferentialFollower & WithMasterID(int newMasterID)
Modifies this Control Request's MasterID parameter and returns itself for method-chaining and easier ...
Definition: DifferentialFollower.hpp:109
int MasterID
Device ID of the differential master to follow.
Definition: DifferentialFollower.hpp:53
std::string ToString() const override
Returns a string representation of the object.
Definition: DifferentialFollower.hpp:157
bool OpposeMasterDirection
Set to false for motor invert to match the master's configured Invert - which is typical when master ...
Definition: DifferentialFollower.hpp:61
Definition: string_util.hpp:15