GCOP  1.0
Classes | Public Member Functions | Public Attributes
gcop::Bulletrccar Class Reference

#include <bulletrccar.h>

Inheritance diagram for gcop::Bulletrccar:
Inheritance graph
[legend]
Collaboration diagram for gcop::Bulletrccar:
Collaboration graph
[legend]

List of all members.

Classes

struct  CarState

Public Member Functions

 Bulletrccar (BulletWorld &m_world, vector< double > *zs_=0)
 ~Bulletrccar ()
double Step (Vector4d &xb, double t, const Vector4d &xa, const Vector2d &u, double h, const VectorXd *p, Matrix4d *A=0, Matrix42d *B=0, Matrix4pd *C=0)
double Step (Vector4d &xb, const Vector2d &u, double h, const VectorXd *p=0, Matrix4d *A=0, Matrix42d *B=0, Matrix4pd *C=0)
double Step (Vector4d &xb, const Vector2d &u, double h, const VectorXd *p, const Vector4d &w, Matrix4d *A=0, Matrix42d *B=0, Matrix4pd *C=0, Matrix4d *D=0)
bool Reset (const Vector4d &x, double t=0)
void setinitialstate (const CarState &inputstate, Vector4d &x)
void setinitialstate (Vector4d &x)
 Set the car initial state as the current state.
bool NoiseMatrix (Matrix4d &Q, double t, const Vector4d &x, const Vector2d &u, double dt, const VectorXd *p)

Public Attributes

int rightIndex
 right of the car index in terms of x,y,z assigns the coordinate sys of car
int upIndex
int forwardIndex
double carmass
 Mass of the car.
btVector3 car_halfdims
 half dimensions of car width, height, length
double gEngineForce
 Engine Torque.
double gBreakingForce
 Breaking Force on the vehicle.
double maxEngineForce
 Maximum Engine force that can be applied.
double maxBreakingForce
 Not Used.
double gVehicleSteering
 Vehicle Steering angle.
double steeringClamp
 Clamp on Steering angle.
double velocityClamp
 Clamp on velocity of car.
double wheelRadius
 Radius of wheel.
double wheelWidth
 Width of wheel.
double wheelFriction
 wheel friction usually large value
double suspensionStiffness
 Stiffness of suspension. If not enough, the car will sink into ground.
double suspensionDamping
 Damping on suspension.
double suspensionCompression
 Compression factor decides by how much the car will compress wrto external loads.
double rollInfluence
btScalar suspensionRestLength
 Rest length of suspension.
btScalar m_defaultContactProcessingThreshold
 if contact goes above this value, it will process
btVector3 wheelDirectionCS0
 direction from the car towards the wheel contact point
btVector3 wheelAxleCS
 Wheel Axle Direction.
double gain_cmdvelocity
 Gain parameter on the commanded velocity. Can be used to convert radio commands into true velocity commands.
double kp_torque
 Proportional gain parameter for commanding torque to get to a desired velocity.
double kp_steer
 Steering proportional gain. Should be between 0 and 1.
double initialz
 Initial height of the car.
btTransform offsettrans
 To Account for the difference to coordinate system Usage: worldpose_inregcoordsys = offsettrans.inv()*worldpose_bullet*offsettrans.
btTransform offsettransinv
 The inverse of the offset transformation above.
vector< double > * zs
 Height of the rccar only used for visualization only x and y are used in optimization.
int count_zs
 Internal variable to find the zs count to fill the height.
bool reset_drivevel
 Used to make sure the velocity of the chassis is used just after reset instead of vehicle vel.
btRigidBody * m_carChassis
 Pointer to the car rigidbody.
btCollisionShape * chassisShape
 Pointer to the car collision shape.
btRaycastVehicle * m_vehicle
 Pointer to the raycast vehicle (Does the constraint enforcing to convert the rigidbody to a vehicle)
btCollisionShape * m_wheelShape
 Shape of the wheels used only for display purposes.
btRaycastVehicle::btVehicleTuning m_tuning
 Tuning parameters for the vehicle used only internally.
btVehicleRaycaster * m_vehicleRayCaster
 Raycaster which gives the point of contact of the vehicle wheels.
BulletWorldm_world
CarStateinitialstate
 Initialstate if passed is stored here.

Detailed Description

A simple rear-drive Rccar model derived from Vehicle Demo using Bullet Physics Engine

This car model uses the full 6DOF state for simulation. To keep compatibility with existing 2D rccar model, this class only provides the state output as $ \bm x = (x,y,\theta, v) \in\mathbb{R}^4$. The controls for the car are given as desired steering angle and desired body velocity. These controls are converted into true controls for the bullet rccar i.e driving torque and actual steering angle through proportional control. The gains for the controller are input as parameters to the system #TODO Use full state of the car

Author: Marin Kobilarov marin(at)jhu.edu Modified: Gowtham Garimella ggarime(at)jhu.edu


Constructor & Destructor Documentation

Bulletrccar::Bulletrccar ( BulletWorld m_world,
vector< double > *  zs_ = 0 
)

Constructor. Each bullet system takes in a world in which it lies.

Parameters:
m_worldWorld class in which the current system lies. Only systems in one world can interact with each other
zs_Vector of car heights along the trajectory used for display purposes.

never deactivate the vehicle from computing collisions etc. Usually the bodies are deactivated after some time if they are not moving

create wheel connections

References gcop::Manifold< T, _n >::bnd, car_halfdims, carmass, chassisShape, forwardIndex, gcop::BulletWorld::IsZupAxis(), gcop::Rccar::l, gcop::Manifold< T, _n >::lb, gcop::BulletWorld::LocalCreateRigidBody(), m_carChassis, gcop::BulletWorld::m_dynamicsWorld, m_tuning, m_vehicle, m_vehicleRayCaster, m_wheelShape, m_world, offsettrans, offsettransinv, rightIndex, rollInfluence, steeringClamp, suspensionCompression, suspensionDamping, suspensionRestLength, suspensionStiffness, gcop::System< T, _nx, _nu, _np >::U, gcop::Manifold< T, _n >::ub, upIndex, velocityClamp, wheelAxleCS, wheelDirectionCS0, wheelFriction, wheelRadius, and wheelWidth.

Destructor: Removes the car and its accessories from the world and deletes them


Member Function Documentation

bool Bulletrccar::NoiseMatrix ( Matrix4d Q,
double  t,
const Vector4d &  x,
const Vector2d &  u,
double  dt,
const VectorXd *  p 
)

Reimplementation of Noise matrix for specific system

bool Bulletrccar::Reset ( const Vector4d &  x,
double  t = 0 
)
void Bulletrccar::setinitialstate ( const CarState inputstate,
Vector4d &  x 
)

Set the intial state of the car to given full state. This overrides the reset state of the car and allows to use full state #TODO Use full stat of the car directly

References gcop::Bulletrccar::CarState::carlinearvel, gcop::Bulletrccar::CarState::cartransform, initialstate, gcop::BulletWorld::IsZupAxis(), m_carChassis, gcop::BulletWorld::m_dynamicsWorld, m_vehicle, m_world, suspensionRestLength, wheelRadius, gcop::System< T, _nx, _nu, _np >::x, and zs.

void Bulletrccar::setinitialstate ( Vector4d &  x)
double Bulletrccar::Step ( Vector4d &  xb,
double  t,
const Vector4d &  xa,
const Vector2d &  u,
double  h,
const VectorXd *  p,
Matrix4d A = 0,
Matrix42d B = 0,
Matrix4pd C = 0 
) [virtual]

Reimplementation of the step function specific to bullet rccar

Reimplemented from gcop::Rccar.

References Reset().

Referenced by Step().

double Bulletrccar::Step ( Vector4d &  xb,
const Vector2d &  u,
double  h,
const VectorXd *  p = 0,
Matrix4d A = 0,
Matrix42d B = 0,
Matrix4pd C = 0 
)
double Bulletrccar::Step ( Vector4d &  xb,
const Vector2d &  u,
double  h,
const VectorXd *  p,
const Vector4d &  w,
Matrix4d A = 0,
Matrix42d B = 0,
Matrix4pd C = 0,
Matrix4d D = 0 
)

References m_carChassis, and Step().


Member Data Documentation

half dimensions of car width, height, length

Referenced by Bulletrccar(), and Reset().

Mass of the car.

Referenced by Bulletrccar(), and Reset().

Pointer to the car collision shape.

Referenced by Bulletrccar(), and Reset().

Internal variable to find the zs count to fill the height.

Referenced by Reset(), and Step().

Referenced by Bulletrccar(), and Reset().

Gain parameter on the commanded velocity. Can be used to convert radio commands into true velocity commands.

Referenced by Step().

Breaking Force on the vehicle.

Referenced by Reset().

Engine Torque.

Referenced by Reset(), and Step().

Vehicle Steering angle.

Referenced by Reset(), and Step().

Initialstate if passed is stored here.

Referenced by Reset(), and setinitialstate().

Initial height of the car.

Referenced by Reset().

Steering proportional gain. Should be between 0 and 1.

Referenced by Step().

Proportional gain parameter for commanding torque to get to a desired velocity.

Referenced by Step().

Pointer to the car rigidbody.

Referenced by Bulletrccar(), Reset(), setinitialstate(), and Step().

if contact goes above this value, it will process

btRaycastVehicle::btVehicleTuning gcop::Bulletrccar::m_tuning

Tuning parameters for the vehicle used only internally.

Referenced by Bulletrccar(), and Reset().

btRaycastVehicle* gcop::Bulletrccar::m_vehicle

Pointer to the raycast vehicle (Does the constraint enforcing to convert the rigidbody to a vehicle)

Referenced by Bulletrccar(), Reset(), setinitialstate(), and Step().

Raycaster which gives the point of contact of the vehicle wheels.

Referenced by Bulletrccar(), and Reset().

Shape of the wheels used only for display purposes.

Referenced by Bulletrccar().

Not Used.

Maximum Engine force that can be applied.

To Account for the difference to coordinate system Usage: worldpose_inregcoordsys = offsettrans.inv()*worldpose_bullet*offsettrans.

Referenced by Bulletrccar(), setinitialstate(), and Step().

The inverse of the offset transformation above.

Referenced by Bulletrccar(), setinitialstate(), and Step().

Used to make sure the velocity of the chassis is used just after reset instead of vehicle vel.

Referenced by Reset(), and Step().

right of the car index in terms of x,y,z assigns the coordinate sys of car

Referenced by Bulletrccar(), and Reset().

Referenced by Bulletrccar(), and Reset().

Clamp on Steering angle.

Referenced by Bulletrccar(), and Step().

Compression factor decides by how much the car will compress wrto external loads.

Referenced by Bulletrccar(), and Reset().

Damping on suspension.

Referenced by Bulletrccar(), and Reset().

Rest length of suspension.

Referenced by Bulletrccar(), Reset(), and setinitialstate().

Stiffness of suspension. If not enough, the car will sink into ground.

Referenced by Bulletrccar(), and Reset().

Referenced by Bulletrccar(), and Reset().

Clamp on velocity of car.

Referenced by Bulletrccar().

Wheel Axle Direction.

Referenced by Bulletrccar(), and Reset().

direction from the car towards the wheel contact point

Referenced by Bulletrccar(), and Reset().

wheel friction usually large value

Referenced by Bulletrccar(), and Reset().

Radius of wheel.

Referenced by Bulletrccar(), Reset(), and setinitialstate().

Width of wheel.

Referenced by Bulletrccar().

vector<double>* gcop::Bulletrccar::zs

Height of the rccar only used for visualization only x and y are used in optimization.

Referenced by Reset(), setinitialstate(), and Step().


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