151 err_type_t _home(
float velocity, u_int8_t sensitivity, u_int8_t current)
override;
168 template <
typename T>
171 template <
typename T>
Generic base class to control a single joint.
Definition mBaseJoint.h:27
u_int8_t flags
State flags transmitted with every I2C transaction.
Definition mBaseJoint.h:394
std::string name
Joint name for logging.
Definition mBaseJoint.h:352
stp_reg_t
register and command definitions
Definition mBaseJoint.h:39
Representing a single hardware joint connected via I2C.
Definition mJoint.h:26
err_type_t postHoming(void) override
perform tasks after a non-blocking homing
Definition mJoint.cpp:68
err_type_t getVelocity(float &vel) override
get the current joint velocity in radians/s or m/s for cylindrical and prismatic joints respectively.
Definition mJoint.cpp:152
err_type_t enableStallguard(u_int8_t sensitivity) override
Enable encoder stall detection of the joint.
Definition mJoint.cpp:246
float reduction
Joint to actuator reduction ratio.
Definition mJoint.h:162
err_type_t setHoldCurrent(u_int8_t current) override
Set the Hold Current.
Definition mJoint.cpp:212
err_type_t setHomingOffset(const float offset)
Stores the homing position on the joint.
Definition mJoint.cpp:287
float max
Joint upper limit.
Definition mJoint.h:165
err_type_t setBrakeMode(u_int8_t mode) override
Set Brake Mode.
Definition mJoint.cpp:220
err_type_t setMaxAcceleration(float maxAccel) override
Set the maximum permitted joint acceleration (and deceleration) in rad/s^2 or m/s^2 for cylindrical a...
Definition mJoint.cpp:228
float min
Joint lower limit.
Definition mJoint.h:164
err_type_t enable(u_int8_t driveCurrent, u_int8_t holdCurrent) override
Engages the joint.
Definition mJoint.cpp:53
err_type_t checkOrientation(float angle=2.0) override
Calls the checkOrientation method of the motor. Checks in which direction the motor is turning.
Definition mJoint.cpp:174
err_type_t setVelocity(float vel) override
Set the current joint velocity in radians/s or m/s for cylindrical and prismatic joints respectively.
Definition mJoint.cpp:162
int write(const stp_reg_t reg, T data, u_int8_t &flags)
Wrapper function to send command to the I2C slave.
Definition mJoint.hpp:62
err_type_t _home(float velocity, u_int8_t sensitivity, u_int8_t current) override
Call to start the homing sequence of a joint.
Definition mJoint.cpp:78
err_type_t stop(void) override
Stops the motor.
Definition mJoint.cpp:187
err_type_t getFlags(void) override
Overload of getFlags(u_int8_t &flags)
Definition mJoint.cpp:267
int read(const stp_reg_t reg, T &data, u_int8_t &flags)
Wrapper function to request data from the I2C slave.
Definition mJoint.hpp:32
err_type_t deinit(void) override
Disconnects from a joint.
Definition mJoint.cpp:46
err_type_t setPosition(float pos) override
get the current joint position in radians or m for cylindrical and prismatic joints respectively.
Definition mJoint.cpp:126
int handle
I2C bus handle.
Definition mJoint.h:175
err_type_t setMaxVelocity(float maxVel) override
Set the maximum permitted joint velocity in rad/s or m/s for cylindrical and prismatic joints respect...
Definition mJoint.cpp:237
err_type_t disableCL(void) override
Definition mJoint.cpp:195
err_type_t checkCom(void)
Check if communication to the joint is established.
Definition mJoint.cpp:254
err_type_t getPosition(float &pos) override
get the current joint position in radians or m for cylindrical and prismatic joints respectively.
Definition mJoint.cpp:113
int address
I2C adress.
Definition mJoint.h:174
err_type_t setDriveCurrent(u_int8_t current) override
Set the Drive Current.
Definition mJoint.cpp:204
err_type_t getHomingOffset(float &offset)
Retrieves the homing position from the last homing.
Definition mJoint.cpp:275
err_type_t init(void) override
Initialize connection to a joint via I2C.
Definition mJoint.cpp:25
~Joint(void)
Destroy the Joint object.
Definition mJoint.cpp:19
err_type_t moveSteps(int32_t steps) override
Move full steps.
Definition mJoint.cpp:142
float offset
Joint position offset.
Definition mJoint.h:163
File including the BaseJoint class.
Templated functions for the Joint class.
Definition mBaseJoint.h:19
err_type_t
Enum defining common error types.
Definition uErr.h:23