JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
motor_force.hpp
Go to the documentation of this file.
1// Copyright (c) JSim contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the LGPLv3 license file in the root directory of this project.
4
5#pragma once
6
8
9namespace frcsim {
10
14class MotorForce : public ForceGenerator {
15public:
16 MotorForce() = default;
17 virtual ~MotorForce() = default;
18
23 void UpdateForce(double duration) override;
24
29 void SetInput(double voltage);
30
31private:
32 double m_inputVoltage = 0.0;
33};
34
35inline void MotorForce::UpdateForce(double duration) {
36 // Basic implementation override
37}
38
39inline void MotorForce::SetInput(double voltage) {
40 m_inputVoltage = voltage;
41}
42
43} // namespace frcsim
Interface for force laws used by the rigid-body integrator.
Definition force_generator.hpp:22
MotorForce()=default
void SetInput(double voltage)
Sets the input voltage or current.
Definition motor_force.hpp:39
void UpdateForce(double duration) override
Applies simulated motor force to the registered object.
Definition motor_force.hpp:35
virtual ~MotorForce()=default
Definition vector.hpp:13