JSim 2026.06.01-p(1)
Loading...
Searching...
No Matches
swerve_model.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#include <vector>
9
10namespace frcsim {
11
12class RigidBody;
13
18 double speed;
19 double angle;
20};
21
26public:
27 SwerveModel() = default;
28 virtual ~SwerveModel() = default;
29
36 virtual void Update(RigidBody* chassis, const std::vector<SwerveModuleState>& states, double dt) = 0;
37};
38
39} // namespace frcsim
Simulated rigid body with translational/angular dynamics and optional aero metadata.
Definition rigid_body.hpp:44
virtual ~SwerveModel()=default
virtual void Update(RigidBody *chassis, const std::vector< SwerveModuleState > &states, double dt)=0
Modifies chassis velocities and apply friction based on swerve module states.
Definition vector.hpp:13
Represents the state of a single swerve module.
Definition swerve_model.hpp:17
double angle
Angle in radians.
Definition swerve_model.hpp:19
double speed
Speed in m/s.
Definition swerve_model.hpp:18