#include <mbd_wheel_joint.h>
Public Types | |
typedef mbd_types::math_policy | math_policy |
typedef mbd_types::math_policy::index_type | size_type |
typedef mbd_types::math_policy::real_type | real_type |
typedef mbd_types::math_policy::vector_range | vector_range |
typedef mbd_types::math_policy::vector3_type | vector3_type |
typedef mbd_types::math_policy::matrix3x3_type | matrix3x3_type |
typedef mbd_types::math_policy::quaternion_type | quaternion_type |
typedef mbd_types::math_policy::idx_vector_range | idx_vector_range |
typedef mbd_types::math_policy::matrix_range | matrix_range |
typedef mbd_types::body_type | body_type |
typedef mbd_types::math_policy::vector_type | vector_type |
typedef mbd_types::math_policy::value_traits | value_traits |
typedef AngularJointLimit < mbd_types > | angular_limit_type |
typedef AngularJointMotor < mbd_types > | angular_motor_type |
Public Member Functions | |
real_type | get_steering_angle () const |
real_type | get_steering_rate () const |
real_type | get_wheel_rate () const |
vector3_type | get_steering_axis_world () const |
vector3_type | get_motor_axis_world () const |
body_type * | get_wheel_body () const |
body_type * | get_car_body () const |
void | set_suspension (real_type const &gamma, real_type const &erp) |
real_type | get_suspension_cfm () const |
real_type | get_suspension_erp () const |
void | set_steering_limit (angular_limit_type const &limit) |
void | set_steering_motor (angular_motor_type const &motor) |
void | set_wheel_motor (angular_motor_type const &motor) |
WheelJoint () | |
virtual | ~WheelJoint () |
void | evaluate () |
size_type | get_number_of_jacobian_rows () const |
void | get_linear_jacobian_A (matrix_range &J) const |
void | get_linear_jacobian_B (matrix_range &J) const |
void | get_angular_jacobian_A (matrix_range &J) const |
void | get_angular_jacobian_B (matrix_range &J) const |
void | get_stabilization_term (vector_range &b_error) const |
void | get_low_limits (vector_range &lo) const |
void | get_high_limits (vector_range &hi) const |
void | get_dependency_indices (idx_vector_range &dep) const |
void | get_dependency_factors (vector_range &factors) const |
void | set_regularization (vector_range const &gamma) |
void | get_regularization (vector_range &gamma) const |
void | set_solution (vector_range const &solution) |
void | get_solution (vector_range &solution) const |
void | calibration () |
Protected Attributes | |
matrix3x3_type | m_R |
Rotation matrix from WCS to locla joint frame. | |
matrix3x3_type | m_J_A |
Angular part of jacobian of body A. | |
matrix3x3_type | m_J_B |
Angular part of jacobian of body B. | |
vector3_type | m_anc_A_wcs |
The anchor point wrt. to body A in WCS. | |
vector3_type | m_anc_B_wcs |
The anchor point wrt. to body B in WCS. | |
vector3_type | m_s |
Suspension axis in WCS. | |
vector3_type | m_t1 |
Orthognal axis on suspension axis in WCS. | |
vector3_type | m_t2 |
Orthognal axis on suspension and t1 axes in WCS. | |
real_type | m_erp_susp |
Error reduction parameter along suspension axis. | |
real_type | m_cfm_susp |
Constraint force mixing parameter along suspension axis. | |
real_type | m_cos_theta0 |
real_type | m_sin_theta0 |
real_type | m_cos_theta |
real_type | m_sin_theta |
vector3_type | m_v1 |
X-axis, used when measuring steering angle. | |
vector3_type | m_v2 |
Y-axis, used when measuring steering angle. | |
vector3_type | m_u |
Constraint axis. | |
size_type | m_rows |
Number of jacobian rows. | |
vector_type | m_gamma |
Local vector of constraint force mixing terms. | |
vector_type | m_solution |
Local solution vector, ie. vector of lagrange multipliers. | |
angular_limit_type * | m_limit |
Steering angle limits. | |
angular_motor_type * | m_motor1 |
Steering axis motor. | |
angular_motor_type * | m_motor2 |
Wheel motor. | |
size_type | m_limit_offset |
size_type | m_motor_offset1 |
size_type | m_motor_offset2 |
A Wheel joint_type. body_type A is the Car object and body_type B is the wheel object.
For fast spinning wheels it is recommend to use:
if(m_wheel.get_wheel_body()) { m_wheel.get_wheel_body()->set_finite_rotation_axis(m_wheel.get_motor_axis_world()); }
This should be done before any position updates.
typedef AngularJointLimit<mbd_types> OpenTissue::mbd::WheelJoint< mbd_types >::angular_limit_type |
typedef AngularJointMotor<mbd_types> OpenTissue::mbd::WheelJoint< mbd_types >::angular_motor_type |
typedef mbd_types::body_type OpenTissue::mbd::WheelJoint< mbd_types >::body_type |
typedef mbd_types::math_policy::idx_vector_range OpenTissue::mbd::WheelJoint< mbd_types >::idx_vector_range |
typedef mbd_types::math_policy OpenTissue::mbd::WheelJoint< mbd_types >::math_policy |
typedef mbd_types::math_policy::matrix3x3_type OpenTissue::mbd::WheelJoint< mbd_types >::matrix3x3_type |
typedef mbd_types::math_policy::matrix_range OpenTissue::mbd::WheelJoint< mbd_types >::matrix_range |
typedef mbd_types::math_policy::quaternion_type OpenTissue::mbd::WheelJoint< mbd_types >::quaternion_type |
typedef mbd_types::math_policy::real_type OpenTissue::mbd::WheelJoint< mbd_types >::real_type |
typedef mbd_types::math_policy::index_type OpenTissue::mbd::WheelJoint< mbd_types >::size_type |
typedef mbd_types::math_policy::value_traits OpenTissue::mbd::WheelJoint< mbd_types >::value_traits |
typedef mbd_types::math_policy::vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::vector3_type |
typedef mbd_types::math_policy::vector_range OpenTissue::mbd::WheelJoint< mbd_types >::vector_range |
typedef mbd_types::math_policy::vector_type OpenTissue::mbd::WheelJoint< mbd_types >::vector_type |
OpenTissue::mbd::WheelJoint< mbd_types >::WheelJoint | ( | ) | [inline] |
virtual OpenTissue::mbd::WheelJoint< mbd_types >::~WheelJoint | ( | ) | [inline, virtual] |
void OpenTissue::mbd::WheelJoint< mbd_types >::calibration | ( | ) | [inline, virtual] |
joint_type Calibration Routine. This method is invoked implicitly whenever the joint connectivity is changed (alteration of anchor points or joint axes).
It can also be invoked directly by and end user if the incident body position and/or rotations is changed.
Implements OpenTissue::mbd::JointInterface< mbd_types >.
void OpenTissue::mbd::WheelJoint< mbd_types >::evaluate | ( | ) | [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_angular_jacobian_A | ( | matrix_range & | J | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_angular_jacobian_B | ( | matrix_range & | J | ) | const [inline] |
body_type* OpenTissue::mbd::WheelJoint< mbd_types >::get_car_body | ( | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_dependency_factors | ( | vector_range & | factors | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_dependency_indices | ( | idx_vector_range & | dep | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_high_limits | ( | vector_range & | hi | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_linear_jacobian_A | ( | matrix_range & | J | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_linear_jacobian_B | ( | matrix_range & | J | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_low_limits | ( | vector_range & | lo | ) | const [inline] |
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::get_motor_axis_world | ( | ) | const [inline] |
size_type OpenTissue::mbd::WheelJoint< mbd_types >::get_number_of_jacobian_rows | ( | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_regularization | ( | vector_range & | gamma | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_solution | ( | vector_range & | solution | ) | const [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::get_stabilization_term | ( | vector_range & | b_error | ) | const [inline] |
real_type OpenTissue::mbd::WheelJoint< mbd_types >::get_steering_angle | ( | ) | const [inline] |
Computes and returns the steering angle.
That is (in world coordinates)
1) Initially project the s_motor axis onto a plane orthogonal to s_steering axis
v1 = s_motor - (s_steering*s_motor)*s_steering v1 = v1/||v1||
Let this vector denote an x-axis in the projected plane.
2) Define the y-axis in the projected plane as
v2 = s_steering X v1
Observe that the s_steering joint axis is the z-axis in this local coordinate frame.
3) During simulation project the current motor axis onto the ``steering axis plane''
s' = s_motor - (s_steering*s_motor)*s_steering
Now
x = s'*v1 y = s'*v2
theta = -atan2(y,x)
Notice that s'*v1 = s_motor*v1, since the projection of s_motor onto the axes v1 and v2 will have the same coordinates as s'.
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::get_steering_axis_world | ( | ) | const [inline] |
real_type OpenTissue::mbd::WheelJoint< mbd_types >::get_steering_rate | ( | ) | const [inline] |
Get Steering Rate (How fast we are turning the steering wheel around the steering axis).
real_type OpenTissue::mbd::WheelJoint< mbd_types >::get_suspension_cfm | ( | ) | const [inline] |
real_type OpenTissue::mbd::WheelJoint< mbd_types >::get_suspension_erp | ( | ) | const [inline] |
body_type* OpenTissue::mbd::WheelJoint< mbd_types >::get_wheel_body | ( | ) | const [inline] |
real_type OpenTissue::mbd::WheelJoint< mbd_types >::get_wheel_rate | ( | ) | const [inline] |
Get Wheel Rate (How fast are the wheel spinning).
void OpenTissue::mbd::WheelJoint< mbd_types >::set_regularization | ( | vector_range const & | gamma | ) | [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::set_solution | ( | vector_range const & | solution | ) | [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::set_steering_limit | ( | angular_limit_type const & | limit | ) | [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::set_steering_motor | ( | angular_motor_type const & | motor | ) | [inline] |
void OpenTissue::mbd::WheelJoint< mbd_types >::set_suspension | ( | real_type const & | gamma, | |
real_type const & | erp | |||
) | [inline] |
Set Suspension. Only works if constraint force mixing is supported (newton damping).
Suspension is modelled by making the steering axis ``soft''
syspension. |
void OpenTissue::mbd::WheelJoint< mbd_types >::set_wheel_motor | ( | angular_motor_type const & | motor | ) | [inline] |
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_anc_A_wcs [protected] |
The anchor point wrt. to body A in WCS.
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_anc_B_wcs [protected] |
The anchor point wrt. to body B in WCS.
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_cfm_susp [protected] |
Constraint force mixing parameter along suspension axis.
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_cos_theta [protected] |
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_cos_theta0 [protected] |
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_erp_susp [protected] |
Error reduction parameter along suspension axis.
vector_type OpenTissue::mbd::WheelJoint< mbd_types >::m_gamma [protected] |
Local vector of constraint force mixing terms.
matrix3x3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_J_A [protected] |
Angular part of jacobian of body A.
matrix3x3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_J_B [protected] |
Angular part of jacobian of body B.
angular_limit_type* OpenTissue::mbd::WheelJoint< mbd_types >::m_limit [protected] |
Steering angle limits.
size_type OpenTissue::mbd::WheelJoint< mbd_types >::m_limit_offset [protected] |
angular_motor_type* OpenTissue::mbd::WheelJoint< mbd_types >::m_motor1 [protected] |
Steering axis motor.
angular_motor_type* OpenTissue::mbd::WheelJoint< mbd_types >::m_motor2 [protected] |
Wheel motor.
size_type OpenTissue::mbd::WheelJoint< mbd_types >::m_motor_offset1 [protected] |
size_type OpenTissue::mbd::WheelJoint< mbd_types >::m_motor_offset2 [protected] |
matrix3x3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_R [protected] |
Rotation matrix from WCS to locla joint frame.
size_type OpenTissue::mbd::WheelJoint< mbd_types >::m_rows [protected] |
Number of jacobian rows.
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_s [protected] |
Suspension axis in WCS.
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_sin_theta [protected] |
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_sin_theta0 [protected] |
vector_type OpenTissue::mbd::WheelJoint< mbd_types >::m_solution [protected] |
Local solution vector, ie. vector of lagrange multipliers.
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_t1 [protected] |
Orthognal axis on suspension axis in WCS.
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_t2 [protected] |
Orthognal axis on suspension and t1 axes in WCS.
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_u [protected] |
Constraint axis.
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_v1 [protected] |
X-axis, used when measuring steering angle.
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_v2 [protected] |
Y-axis, used when measuring steering angle.