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

Test for rotational motion. More...

#include <IntegratorRotationTest.hpp>

Inherits IntegratorTest.

Public Types

typedef rw::core::Ptr< IntegratorRotationTestPtr
 Smart pointer to IntegratorRotationTest.
 
- Public Types inherited from EngineTest
typedef rw::core::Ptr< EngineTestPtr
 Smart pointer to EngineTest.
 
typedef std::function< void(double time, bool failed, bool done)> TimeCallback
 The callback type for the current simulation time.
 

Public Member Functions

 IntegratorRotationTest ()
 Constructor.
 
virtual ~IntegratorRotationTest ()
 Destructor.
 
virtual void run (TestHandle::Ptr handle, const std::string &engineID, const rw::core::PropertyMap &parameters, rw::core::Ptr< rwsim::log::SimulatorLogScope > verbose=NULL)
 Run the test. More...
 
virtual double getRunTime () const
 Get the length of the simulation. More...
 
virtual rw::core::Ptr< rwsim::dynamics::DynamicWorkCellmakeIntegratorDWC (const std::string &integratorType="")
 Create new dynamic workcell. More...
 
- Public Member Functions inherited from IntegratorTest
 IntegratorTest ()
 Constructor.
 
virtual ~IntegratorTest ()
 Destructor.
 
virtual bool isEngineSupported (const std::string &engineID) const
 Check if engine with specific name is supported by the test. More...
 
virtual rw::core::Ptr< rwsim::dynamics::DynamicWorkCellgetDWC (const rw::core::PropertyMap &map)
 Get the dynamic workcell used by the test. More...
 
virtual rw::core::Ptr< rw::core::PropertyMapgetDefaultParameters () const
 Get the default parameters used by the test. More...
 
- Public Member Functions inherited from EngineTest
 EngineTest ()
 Construct new test.
 
virtual ~EngineTest ()
 Destructor.
 
virtual TestHandle::Ptr runThread (const std::string &engineID, const rw::core::PropertyMap &parameters, rw::core::Ptr< rwsim::log::SimulatorLogScope > verbose, rw::core::Ptr< rw::common::ThreadTask > task)
 Run the test in a separate thread. More...
 
virtual void run (TestHandle::Ptr handle, const std::string &engineID, const rw::core::PropertyMap &parameters, rw::core::Ptr< rwsim::log::SimulatorLogScope > verbose=NULL)=0
 Run the test. More...
 
virtual std::vector< rw::core::Ptr< rw::core::PropertyMap > > getPredefinedParameters () const
 Get a vector of predefined parameters. More...
 

Static Public Member Functions

static double getExpectedEnergy (rw::core::Ptr< const rwsim::dynamics::DynamicWorkCell > dwc)
 Get the expected kinetic energy. More...
 

Additional Inherited Members

- Protected Types inherited from EngineTest
typedef std::function< void(rw::core::Ptr< const rwsim::dynamics::DynamicWorkCell >, rw::kinematics::State &)> InitCallback
 Type for a function initializing the state.
 
typedef std::function< void(const EngineLoopInfo &)> TestCallback
 Type for a callback function.
 
- Protected Member Functions inherited from EngineTest
void runEngineLoop (double dt, TestHandle::Ptr handle, const std::string &engineID, const rw::core::PropertyMap &parameters, rw::core::Ptr< rwsim::log::SimulatorLogScope > verbose, TestCallback callback=0, InitCallback initialize=0)
 A standard stepping loop provided as a convenience for test implementations. More...
 

Detailed Description

Test for rotational motion.

According to Euler's equations of motion, the rotation around a non-inertial axis of a body will cause a non-linear term in the equations of motion. The simulation is illustrated below:

Motion of rotating body with no gravity.

An analytical solution is NOT given for this type of motion. In this test the focus is on preservation of energy.

Member Function Documentation

◆ getExpectedEnergy()

static double getExpectedEnergy ( rw::core::Ptr< const rwsim::dynamics::DynamicWorkCell dwc)
static

Get the expected kinetic energy.

Parameters
dwc[in] the dynamic workcell.
Returns
the energy.

◆ getRunTime()

virtual double getRunTime ( ) const
virtual

Get the length of the simulation.

Returns
the length of the simulation.

Implements EngineTest.

◆ makeIntegratorDWC()

virtual rw::core::Ptr<rwsim::dynamics::DynamicWorkCell> makeIntegratorDWC ( const std::string &  integratorType = "")
virtual

Create new dynamic workcell.

Parameters
integratorType[in] (optional) the integrator to use.
Returns
the dynamic workcell.

Reimplemented from IntegratorTest.

◆ run()

virtual void run ( TestHandle::Ptr  handle,
const std::string &  engineID,
const rw::core::PropertyMap parameters,
rw::core::Ptr< rwsim::log::SimulatorLogScope verbose = NULL 
)
virtual

Run the test.

Parameters
handle[in/out] a TestHandle where the results of the test will be added to.
engineID[in] the id of the engine to run test for.
parameters[in] the parameters for the test run.
verbose[in] (optional) record detailed internal debug information in the engine during simulation.

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