14#include <units/frequency.h>
15#include <units/time.h>
31 bool ApplyConfigsOnRequest{
false};
33 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash,
bool cancelOtherRequests, std::shared_ptr<ControlRequest> &req)
override
35 if (req.get() !=
this)
37 auto const reqCast =
dynamic_cast<Follower *
>(req.get());
38 if (reqCast !=
nullptr)
44 req = std::make_shared<Follower>(*
this);
50 std::string strs{ss.str()};
52 ApplyConfigsOnRequest =
false;
163 std::stringstream ss;
164 ss <<
"class: Follower" << std::endl;
165 ss <<
"MasterID: " <<
MasterID << std::endl;
184 std::map<std::string, std::string> controlInfo;
185 std::stringstream ss;
186 controlInfo[
"Name"] =
GetName();
187 ss <<
MasterID; controlInfo[
"MasterID"] = ss.str(); ss.str(std::string{});
CTREXPORT int c_ctre_phoenix6_RequestControlFollower(const char *canbus, uint32_t ecuEncoding, double updateTime, bool cancelOtherRequests, int MasterID, bool OpposeMasterDirection)
CTREXPORT int c_ctre_phoenix6_requestConfigApply(const char *canbus, uint32_t ecuEncoding, double timeoutSeconds, const char *str, uint32_t strlen, bool forceApply)
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 motor output of another Talon.
Definition: Follower.hpp:30
units::time::second_t ConfigTimeout
The timeout when sending configs associated with this control.
Definition: Follower.hpp:75
Follower & WithMasterID(int newMasterID)
Modifies this Control Request's MasterID parameter and returns itself for method-chaining and easier ...
Definition: Follower.hpp:120
std::string ToString() const override
Returns a string representation of the object.
Definition: Follower.hpp:161
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition: Follower.hpp:182
Follower & WithOpposeMasterDirection(bool newOpposeMasterDirection)
Modifies this Control Request's OpposeMasterDirection parameter and returns itself for method-chainin...
Definition: Follower.hpp:132
bool OpposeMasterDirection
Set to false for motor invert to match the master's configured Invert - which is typical when master ...
Definition: Follower.hpp:68
Follower(int MasterID, bool OpposeMasterDirection)
Follow the motor output of another Talon.
Definition: Follower.hpp:109
void ForceApplyConfigs()
Forces configs to be applied the next time this is used in a setControl.
Definition: Follower.hpp:175
Follower & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition: Follower.hpp:151
units::frequency::hertz_t UpdateFreqHz
The period at which this control will update at.
Definition: Follower.hpp:88
int MasterID
Device ID of the master to follow.
Definition: Follower.hpp:60
Definition: ManualEvent.hpp:12