RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
KinematicDevice Class Reference

a kinematic device is able to influence the simulated environment but the device is not influenced by any external force as is the RigidDevice. More...

#include <KinematicDevice.hpp>

Inherits DynamicDevice.

Public Types

typedef rw::core::Ptr< KinematicDevicePtr
 Smart pointer type for a KinematicDevice.
 
- Public Types inherited from DynamicDevice
typedef rw::core::Ptr< DynamicDevicePtr
 Smart pointer type for a DynamicDevice.
 
- Public Types inherited from Stateless
typedef rw::core::Ptr< StatelessPtr
 Smart pointer type for Stateless.
 

Public Member Functions

 KinematicDevice (dynamics::Body::Ptr base, const std::vector< std::pair< BodyInfo, rw::core::Ptr< rw::models::Object >>> &objects, rw::models::JointDevice::Ptr dev)
 Construct new kinematic device. More...
 
virtual ~KinematicDevice ()
 destructor
 
rw::math::Q getJointVelocities (const rw::kinematics::State &state)
 get the current velocities of all joints More...
 
void setJointVelocities (const rw::math::Q &vel, rw::kinematics::State &state)
 Set the velocities of the joints. More...
 
const std::vector< Body::Ptr > & getLinks ()
 get the kinematic bodies that this KinematicDevice controls. The bodies are ordered such that device joint i maps to kinematic body i More...
 
void setMaxAcc (const rw::math::Q &acc)
 Set maximum acceleration for the joints. More...
 
rw::math::Q getMaxAcc ()
 Get the maximum joint accelerations. More...
 
void setMaxVel (const rw::math::Q &vel)
 Set the maximum joint velocities. More...
 
rw::math::Q getMaxVel ()
 Get the maximum joint velocities. More...
 
rw::models::JointDevice::Ptr getJointDevice ()
 Get the kinematic model. More...
 
- Public Member Functions inherited from DynamicDevice
virtual ~DynamicDevice ()
 Destructor.
 
virtual rw::math::Q getQ (const rw::kinematics::State &state)
 gets the position
 
virtual void setQ (const rw::math::Q &q, rw::kinematics::State &state)
 Set the position of the joints. More...
 
rw::models::DevicegetModel ()
 gets the kinematic model of the DynamicDevice.
 
rw::models::Device::Ptr getKinematicModel ()
 Get the kinematic model of the device. More...
 
dynamics::Body::Ptr getBase ()
 Get the base of the device. More...
 
virtual rw::math::Q getVelocity (const rw::kinematics::State &state)
 deprecated More...
 
virtual void setVelocity (const rw::math::Q &vel, rw::kinematics::State &state)
 Set the velocities of the joints. More...
 
virtual void setMotorVelocityTargets (const rw::math::Q &vel, rw::kinematics::State &state)
 Set motor targets for the joints. More...
 
const std::string & getName () const
 Get the name of the dynamic device. More...
 
- Public Member Functions inherited from Stateless
virtual ~Stateless ()
 destructor
 
virtual void registerIn (State &state)
 initialize this stateless data to a specific state More...
 
virtual void registerIn (StateStructure::Ptr state)
 register this stateless object in a statestructure.
 
virtual void unregister ()
 unregisters all state data of this stateless object
 
StateStructure::Ptr getStateStructure ()
 Get the state structure. More...
 
const StateStructure::Ptr getStateStructure () const
 Get the state structure. More...
 
bool isRegistered ()
 Check if object has registered its state. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DynamicDevice
 DynamicDevice (dynamics::Body::Ptr base, rw::models::Device::Ptr dev)
 Construct new dynamic device. More...
 
- Protected Member Functions inherited from Stateless
 Stateless ()
 constructor
 
template<class T >
void add (StatelessData< T > &data)
 implementations of sensor should add all their stateless data on initialization
 
void add (StateData *data)
 Add data. More...
 
void add (rw::core::Ptr< StateData > data)
 implementations of sensor should add all their state data on initialization
 
- Protected Attributes inherited from DynamicDevice
rw::models::Device::Ptr _dev
 The kinematic model.
 
dynamics::Body::Ptr _base
 The base of the device.
 
- Protected Attributes inherited from Stateless
bool _registered
 True if object has registered its state.
 
std::vector< rw::core::Ptr< StateData > > _datas
 Data.
 
StateStructure::Ptr _stateStruct
 The state structure.
 

Detailed Description

a kinematic device is able to influence the simulated environment but the device is not influenced by any external force as is the RigidDevice.

The kinematic device is velocity controlled and if the acceleration limits permit then the velocity of the kinematic device will be equal to the target velocity in the next step of the simulator.

This class is especially usefull for animating robot devices in a simulated environment.

Constructor & Destructor Documentation

◆ KinematicDevice()

KinematicDevice ( dynamics::Body::Ptr  base,
const std::vector< std::pair< BodyInfo, rw::core::Ptr< rw::models::Object >>> &  objects,
rw::models::JointDevice::Ptr  dev 
)

Construct new kinematic device.

Parameters
base[in] base of the device.
objects[in] vector of links. Each linksis given as the dynamic body parameters and the object geometry.
dev[in] the kinematic model.

Member Function Documentation

◆ getJointDevice()

rw::models::JointDevice::Ptr getJointDevice ( )
inline

Get the kinematic model.

Returns
the kinematic model of the device.

◆ getJointVelocities()

rw::math::Q getJointVelocities ( const rw::kinematics::State state)
inlinevirtual

get the current velocities of all joints

Parameters
state[in] the state
Returns
velocites of all joints

Implements DynamicDevice.

◆ getLinks()

const std::vector<Body::Ptr>& getLinks ( )
inlinevirtual

get the kinematic bodies that this KinematicDevice controls. The bodies are ordered such that device joint i maps to kinematic body i

Returns
all bodies that the device controls.

Implements DynamicDevice.

◆ getMaxAcc()

rw::math::Q getMaxAcc ( )

Get the maximum joint accelerations.

Returns
the maximum accelerations.

◆ getMaxVel()

rw::math::Q getMaxVel ( )

Get the maximum joint velocities.

Returns
the maximum velocities.

◆ setJointVelocities()

void setJointVelocities ( const rw::math::Q vel,
rw::kinematics::State state 
)
inlinevirtual

Set the velocities of the joints.

Parameters
vel[in] the joint velocities.
state[out] the state with updated velocities.

Implements DynamicDevice.

◆ setMaxAcc()

void setMaxAcc ( const rw::math::Q acc)

Set maximum acceleration for the joints.

Parameters
acc[in] the maximum accelerations.

◆ setMaxVel()

void setMaxVel ( const rw::math::Q vel)

Set the maximum joint velocities.

Parameters
vel[in] the maximum velocities.

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