Public Types | Public Member Functions | Protected Attributes

OpenTissue::mbd::WheelJoint< mbd_types > Class Template Reference

#include <mbd_wheel_joint.h>

Inheritance diagram for OpenTissue::mbd::WheelJoint< mbd_types >:
OpenTissue::mbd::JointInterface< mbd_types >

List of all members.

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_typeget_wheel_body () const
body_typeget_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_typem_limit
 Steering angle limits.
angular_motor_typem_motor1
 Steering axis motor.
angular_motor_typem_motor2
 Wheel motor.
size_type m_limit_offset
size_type m_motor_offset1
size_type m_motor_offset2

Detailed Description

template<typename mbd_types>
class OpenTissue::mbd::WheelJoint< mbd_types >

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.


Member Typedef Documentation

template<typename mbd_types >
typedef AngularJointLimit<mbd_types> OpenTissue::mbd::WheelJoint< mbd_types >::angular_limit_type
template<typename mbd_types >
typedef AngularJointMotor<mbd_types> OpenTissue::mbd::WheelJoint< mbd_types >::angular_motor_type
template<typename mbd_types >
typedef mbd_types::body_type OpenTissue::mbd::WheelJoint< mbd_types >::body_type
template<typename mbd_types >
typedef mbd_types::math_policy::idx_vector_range OpenTissue::mbd::WheelJoint< mbd_types >::idx_vector_range
template<typename mbd_types >
typedef mbd_types::math_policy OpenTissue::mbd::WheelJoint< mbd_types >::math_policy
template<typename mbd_types >
typedef mbd_types::math_policy::matrix3x3_type OpenTissue::mbd::WheelJoint< mbd_types >::matrix3x3_type
template<typename mbd_types >
typedef mbd_types::math_policy::matrix_range OpenTissue::mbd::WheelJoint< mbd_types >::matrix_range
template<typename mbd_types >
typedef mbd_types::math_policy::quaternion_type OpenTissue::mbd::WheelJoint< mbd_types >::quaternion_type
template<typename mbd_types >
typedef mbd_types::math_policy::real_type OpenTissue::mbd::WheelJoint< mbd_types >::real_type
template<typename mbd_types >
typedef mbd_types::math_policy::index_type OpenTissue::mbd::WheelJoint< mbd_types >::size_type
template<typename mbd_types >
typedef mbd_types::math_policy::value_traits OpenTissue::mbd::WheelJoint< mbd_types >::value_traits
template<typename mbd_types >
typedef mbd_types::math_policy::vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::vector3_type
template<typename mbd_types >
typedef mbd_types::math_policy::vector_range OpenTissue::mbd::WheelJoint< mbd_types >::vector_range
template<typename mbd_types >
typedef mbd_types::math_policy::vector_type OpenTissue::mbd::WheelJoint< mbd_types >::vector_type

Constructor & Destructor Documentation

template<typename mbd_types >
OpenTissue::mbd::WheelJoint< mbd_types >::WheelJoint (  )  [inline]
template<typename mbd_types >
virtual OpenTissue::mbd::WheelJoint< mbd_types >::~WheelJoint (  )  [inline, virtual]

Member Function Documentation

template<typename mbd_types >
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 >.

template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::evaluate (  )  [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_angular_jacobian_A ( matrix_range J  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_angular_jacobian_B ( matrix_range J  )  const [inline]
template<typename mbd_types >
body_type* OpenTissue::mbd::WheelJoint< mbd_types >::get_car_body (  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_dependency_factors ( vector_range factors  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_dependency_indices ( idx_vector_range dep  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_high_limits ( vector_range hi  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_linear_jacobian_A ( matrix_range J  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_linear_jacobian_B ( matrix_range J  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_low_limits ( vector_range lo  )  const [inline]
template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::get_motor_axis_world (  )  const [inline]
template<typename mbd_types >
size_type OpenTissue::mbd::WheelJoint< mbd_types >::get_number_of_jacobian_rows (  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_regularization ( vector_range gamma  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_solution ( vector_range solution  )  const [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::get_stabilization_term ( vector_range b_error  )  const [inline]
template<typename mbd_types >
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'.

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::get_steering_axis_world (  )  const [inline]
template<typename mbd_types >
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).

Returns:
The rate.
template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::get_suspension_cfm (  )  const [inline]
template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::get_suspension_erp (  )  const [inline]
template<typename mbd_types >
body_type* OpenTissue::mbd::WheelJoint< mbd_types >::get_wheel_body (  )  const [inline]
template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::get_wheel_rate (  )  const [inline]

Get Wheel Rate (How fast are the wheel spinning).

Returns:
The rate.
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::set_regularization ( vector_range const &  gamma  )  [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::set_solution ( vector_range const &  solution  )  [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::set_steering_limit ( angular_limit_type const &  limit  )  [inline]
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::set_steering_motor ( angular_motor_type const &  motor  )  [inline]
template<typename mbd_types >
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''

Parameters:
syspension. 
template<typename mbd_types >
void OpenTissue::mbd::WheelJoint< mbd_types >::set_wheel_motor ( angular_motor_type const &  motor  )  [inline]

Member Data Documentation

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_anc_A_wcs [protected]

The anchor point wrt. to body A in WCS.

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_anc_B_wcs [protected]

The anchor point wrt. to body B in WCS.

template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_cfm_susp [protected]

Constraint force mixing parameter along suspension axis.

template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_cos_theta [protected]
template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_cos_theta0 [protected]
template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_erp_susp [protected]

Error reduction parameter along suspension axis.

template<typename mbd_types >
vector_type OpenTissue::mbd::WheelJoint< mbd_types >::m_gamma [protected]

Local vector of constraint force mixing terms.

template<typename mbd_types >
matrix3x3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_J_A [protected]

Angular part of jacobian of body A.

template<typename mbd_types >
matrix3x3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_J_B [protected]

Angular part of jacobian of body B.

template<typename mbd_types >
angular_limit_type* OpenTissue::mbd::WheelJoint< mbd_types >::m_limit [protected]

Steering angle limits.

template<typename mbd_types >
size_type OpenTissue::mbd::WheelJoint< mbd_types >::m_limit_offset [protected]
template<typename mbd_types >
angular_motor_type* OpenTissue::mbd::WheelJoint< mbd_types >::m_motor1 [protected]

Steering axis motor.

template<typename mbd_types >
angular_motor_type* OpenTissue::mbd::WheelJoint< mbd_types >::m_motor2 [protected]

Wheel motor.

template<typename mbd_types >
size_type OpenTissue::mbd::WheelJoint< mbd_types >::m_motor_offset1 [protected]
template<typename mbd_types >
size_type OpenTissue::mbd::WheelJoint< mbd_types >::m_motor_offset2 [protected]
template<typename mbd_types >
matrix3x3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_R [protected]

Rotation matrix from WCS to locla joint frame.

template<typename mbd_types >
size_type OpenTissue::mbd::WheelJoint< mbd_types >::m_rows [protected]

Number of jacobian rows.

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_s [protected]

Suspension axis in WCS.

template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_sin_theta [protected]
template<typename mbd_types >
real_type OpenTissue::mbd::WheelJoint< mbd_types >::m_sin_theta0 [protected]
template<typename mbd_types >
vector_type OpenTissue::mbd::WheelJoint< mbd_types >::m_solution [protected]

Local solution vector, ie. vector of lagrange multipliers.

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_t1 [protected]

Orthognal axis on suspension axis in WCS.

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_t2 [protected]

Orthognal axis on suspension and t1 axes in WCS.

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_u [protected]

Constraint axis.

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_v1 [protected]

X-axis, used when measuring steering angle.

template<typename mbd_types >
vector3_type OpenTissue::mbd::WheelJoint< mbd_types >::m_v2 [protected]

Y-axis, used when measuring steering angle.


The documentation for this class was generated from the following file: