34#include <NDEVR/Device.h>
35#include <NDEVR/Angle.h>
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
A specification of upper and lower bounds in N-dimensions.
Device(const Model &model, LogPtr log, QObject *parent=nullptr)
Constructs a Device from a Model with the given log and optional Qt parent.
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
Templated logic for doing matrix multiplication.
A core class that represents a node on model hierarchy.
Bounds< 1, Angle< fltp08 > > m_bounds
The angular position bounds for the motor.
virtual Angle< fltp08 > location() const
Returns the current angular position of the motor.
Angle< fltp08 > m_current_angle
The current angular position.
virtual void setParkAngle(const Angle< fltp08 > &location)
Sets the park angle position for the motor.
virtual void updateModel()
Updates the associated model's transform to reflect the motor's current position.
virtual Angle< fltp08 > preferredSpeed() const
Returns the preferred rotational speed of the motor.
bool m_activated
Whether the motor is currently activated.
Bounds< 2, Angle< fltp08 > > m_speed_range
The allowable speed range (forward and reverse).
virtual void setCenterOfRotation(const Vector< 3, fltp08 > &rotation_axis)
Sets the center of rotation for the motor.
virtual bool supportsMoveTo() const
Returns whether this motor supports move-to-angle commands.
virtual void setSpeed(const Angle< fltp08 > &speed)
Sets the rotational speed of the motor.
virtual bool activated() const
Returns whether the motor is currently activated.
virtual bool supportsSetSpeed() const
Returns whether this motor supports set-speed commands.
fltp08 m_torque_limit
The torque limit for the motor.
Angle< fltp08 > m_target_angle
The target angle the motor is moving toward.
virtual void parkMotorAtSpeed(const Angle< fltp08 > &speed)
Moves the motor to its park angle at the specified speed.
Angle< fltp08 > m_park_angle
The park angle position.
virtual void setActivated(bool activated)
Activates or deactivates the motor.
Motor(const Model &model, LogPtr log=nullptr, QObject *parent=nullptr)
Constructs a Motor device.
void parkMotor()
Moves the motor to its park angle at the preferred speed.
virtual Angle< fltp08 > targetAngle() const
Returns the target angle the motor is moving toward.
void setSpeedRange(const Bounds< 2, Angle< fltp08 > > &speed_range)
Sets the allowable speed range for the motor.
virtual Angle< fltp08 > speed() const
Returns the current angular speed of the motor.
Vector< 3, fltp08 > m_center_of_rotation
The 3D center of rotation.
Time m_last_speed_time
Timestamp of the last speed-based position update.
Angle< fltp08 > m_current_speed
The current angular speed per second.
Vector< 3, fltp08 > m_axis_of_rotation
The 3D axis of rotation.
virtual void setAxisOfRotation(const Vector< 3, fltp08 > &rotation_axis)
Sets the axis of rotation for the motor.
Angle< fltp08 > m_preferred_speed
The preferred rotational speed.
virtual void setPreferredSpeed(const Angle< fltp08 > &location)
Sets the preferred rotational speed.
virtual void setTargetAndSpeed(const Angle< fltp08 > &location, const Angle< fltp08 > &speed)
Sets both the target angle and the speed to reach it.
void updatePositionFromSpeed(Time current_time)
Updates the motor position based on its current speed and elapsed time.
virtual void setTorqueLimit(fltp08 limit)
Sets the torque limit for the motor.
virtual Angle< fltp08 > parkAngle() const
Returns the motor's park angle position.
Matrix< fltp08 > m_model_transform_offset
Transform offset applied to the model.
virtual Bounds< 2, Angle< fltp08 > > speedRange() const
Returns the speed range (forward and reverse) for the motor.
virtual void setLocation(const Angle< fltp08 > &location)
Sets the current angular position of the motor.
virtual void setModelTransformOffset(const Matrix< fltp08 > &offset)
Sets a transform offset applied to the model when updating its position.
void setTarget(const Angle< fltp08 > &location)
Sets the target angle for the motor to move to.
Represents a timestamp with utilities for manipulation and conversion.
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
The primary namespace for the NDEVR SDK.
double fltp08
Defines an alias representing an 8 byte floating-point number.
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...