API Documentation
Loading...
Searching...
No Matches
Motor.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Hardware
28File: Motor
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/Device.h>
35#include <NDEVR/Angle.h>
36namespace NDEVR
37{
38 class Log;
39 /**--------------------------------------------------------------------------------------------------
40 \brief A motor is a device which produces rotational spin. This could be anything from a servo motor
41 to a rapidly spinning device with an apx RPM.
42 **/
43 class HARDWARE_API Motor : public Device
44 {
45 public:
46 Motor(const Model& model, ProgressInfo* log = nullptr, QObject* parent = nullptr);
47 [[nodiscard]] virtual Angle<fltp08> location() const;
48 [[nodiscard]] virtual Angle<fltp08> speed() const { return m_current_speed; }
49 [[nodiscard]] virtual Angle<fltp08> parkAngle() const { return m_park_angle; }
50 [[nodiscard]] virtual Angle<fltp08> preferredSpeed() const { return m_preferred_speed; }
51 [[nodiscard]] virtual bool supportsMoveTo() const;
52 [[nodiscard]] virtual bool supportsSetSpeed() const;
53 [[nodiscard]] virtual bool activated() const { return m_activated; };
54 virtual void setLocation(const Angle<fltp08>& location);
55 void setTarget(const Angle<fltp08>& location);
56 virtual void setTarget(const Angle<fltp08>& location, const Angle<fltp08>& speed);
57 virtual void setModelTransformOffset(const Matrix<fltp08>& offset);
58 virtual void setParkAngle(const Angle<fltp08>& location);
59 virtual void setPreferredSpeed(const Angle<fltp08>& location) { m_preferred_speed = location; };
60 virtual void setAxisOfRotation(const Vector<3, fltp08>& rotation_axis);
61 virtual void setTorqueLimit(fltp08 limit) { m_torque_limit = limit; }
62
63 //Speed forward and reverse
65 virtual void setSpeed(const Angle<fltp08>& speed);
66 //turn the motor on or off
67 virtual void setActivated(bool activated);
68 void parkMotor();
69 virtual void parkMotor(const Angle<fltp08>& speed);
70 virtual void updateModel();
71 protected:
83 };
84}
#define HARDWARE_API
Definition DLLInfo.h:56
The primary angle storage class for this API. Stores an angle in an optimized format.
Definition StringStream.h:540
A specification of upper and lower bounds in N-dimensions.
Definition Bounds.hpp:52
A root class which describes some physical object, such as a Motor, Sensor, or Connection....
Definition Device.h:52
Definition Matrix.hpp:176
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
A motor is a device which produces rotational spin. This could be anything from a servo motor to a ra...
Definition Motor.h:44
Matrix< fltp08 > m_model_transform_offset
Definition Motor.h:78
virtual void setSpeed(const Angle< fltp08 > &speed)
virtual Angle< fltp08 > parkAngle() const
Definition Motor.h:49
virtual bool supportsSetSpeed() const
virtual void updateModel()
Angle< fltp08 > m_preferred_speed
Definition Motor.h:76
Vector< 3, fltp08 > m_axis_of_rotation
Definition Motor.h:73
virtual Angle< fltp08 > preferredSpeed() const
Definition Motor.h:50
Angle< fltp08 > m_current_angle
Definition Motor.h:74
void setTarget(const Angle< fltp08 > &location)
virtual bool activated() const
Definition Motor.h:53
Angle< fltp08 > m_park_angle
Definition Motor.h:79
virtual Bounds< 2, Angle< fltp08 > > speedRange() const
Definition Motor.h:64
virtual void setAxisOfRotation(const Vector< 3, fltp08 > &rotation_axis)
virtual void setParkAngle(const Angle< fltp08 > &location)
void parkMotor()
Motor(const Model &model, ProgressInfo *log=nullptr, QObject *parent=nullptr)
virtual Angle< fltp08 > speed() const
Definition Motor.h:48
Angle< fltp08 > m_current_speed
Definition Motor.h:75
virtual void setModelTransformOffset(const Matrix< fltp08 > &offset)
virtual void parkMotor(const Angle< fltp08 > &speed)
Angle< fltp08 > m_target_angle
Definition Motor.h:77
virtual void setActivated(bool activated)
virtual bool supportsMoveTo() const
virtual Angle< fltp08 > location() const
bool m_activated
Definition Motor.h:82
virtual void setLocation(const Angle< fltp08 > &location)
fltp08 m_torque_limit
Definition Motor.h:81
virtual void setTarget(const Angle< fltp08 > &location, const Angle< fltp08 > &speed)
Time m_initial_target_time
Definition Motor.h:80
virtual void setPreferredSpeed(const Angle< fltp08 > &location)
Definition Motor.h:59
Bounds< 1, Angle< fltp08 > > m_bounds
Definition Motor.h:72
virtual void setTorqueLimit(fltp08 limit)
Definition Motor.h:61
A light-weight base class for Log that allows processes to update, without the need for additional in...
Definition ProgressInfo.hpp:48
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:54
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Definition ACIColor.h:37
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233