14#include <units/frequency.h>
15#include <units/time.h>
31 bool ApplyConfigsOnRequest;
33 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash,
bool cancelOtherRequests, std::shared_ptr<ControlRequest> &req)
37 ss <<
MasterID; ref[
"MasterID"] = ss.str(); ss.str(std::string());
40 if (req.get() !=
this)
42 auto const reqCast =
dynamic_cast<Follower *
>(req.get());
43 if (reqCast !=
nullptr)
49 req = std::make_shared<Follower>(*
this);
54 std::string strs{ss.str()};
56 ApplyConfigsOnRequest =
false;
169 std::stringstream ss;
170 ss <<
"class: Follower" << std::endl;
171 ss <<
"MasterID: " <<
MasterID << std::endl;
CTREXPORT int c_ctre_phoenixpro_requestConfigApply(const char *canbus, uint32_t ecuEncoding, double timeoutSeconds, const char *str, uint32_t strlen, bool forceApply)
CTREXPORT int c_ctre_phoenixpro_RequestControlFollower(const char *canbus, uint32_t ecuEncoding, double updateTime, bool cancelOtherRequests, int MasterID, bool OpposeMasterDirection)
std::map< std::string, std::string > & GetNameValues()
Gets the map of control parameter names to the corresponding applied value.
Definition: ControlRequest.hpp:52
Abstract Control Request class that other control requests extend for use.
Definition: ControlRequest.hpp:65
ControlInfo requestReference
Definition: ControlRequest.hpp:70
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:126
void ForceApplyConfigs()
Forces configs to be applied the next time this is used in a setControl.
Definition: Follower.hpp:181
Follower(int MasterID, bool OpposeMasterDirection)
Follow the motor output of another Talon.
Definition: Follower.hpp:114
std::string ToString() const
Returns a string representation of the object.
Definition: Follower.hpp:167
units::frequency::hertz_t UpdateFreqHz
The period at which this control will update at.
Definition: Follower.hpp:92
Follower & WithOpposeMasterDirection(bool newOpposeMasterDirection)
Modifies this Control Request's OpposeMasterDirection parameter and returns itself for method-chainin...
Definition: Follower.hpp:138
units::time::second_t ConfigTimeout
The timeout when sending configs associated with this control.
Definition: Follower.hpp:79
int MasterID
Device ID of the master to follow.
Definition: Follower.hpp:64
bool OpposeMasterDirection
Set to false for motor invert to match the master's configured Invert - which is typical when master ...
Definition: Follower.hpp:72
Follower & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition: Follower.hpp:157
Definition: string_util.hpp:14