summaryrefslogtreecommitdiff
path: root/LocomotorPrimitivesController.h
blob: a2d1f30fef55288e710ff4086745de1b394db5ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef LOCOMOTORPRIMITIVES_CONTROLLER_H_
#define LOCOMOTORPRIMITIVES_CONTROLLER_H_

#include <OpenSim/OpenSim.h>

#include "Logger.h"

class LocomotorPrimitivesController : public OpenSim::Controller {
OpenSim_DECLARE_CONCRETE_OBJECT(LocomotorPrimitivesController, OpenSim::Controller);

public:
	LocomotorPrimitivesController(OpenSim::Storage act, double alpha)
		: OpenSim::Controller(), _act(act), _alpha(alpha)
	{
		_muscle_act = new double[act.getSmallestNumberOfStates()];
	}

	~LocomotorPrimitivesController()
	{
		delete[] _muscle_act;
	}

	/**
	 * Check availability of control data for all controls in the model.
	 *
	 * @return    0 if control data is available for all controls, negative
	 *            number of missing control data vectors on error
	 */
	int checkControls();
	void computeControls(const SimTK::State &s, SimTK::Vector &controls) const;
private:
	double _alpha;
	/* used to store actuation data in compute controls */
	double *_muscle_act;

	OpenSim::Storage _act;

	int getAndInitActuationData(const double t) const;
	double getMuscleActivation(const std::string &muscle_name) const;
};

#endif /* LOCOMOTORPRIMITIVES_CONTROLLER_H_ */
tes the latency constraints to find out whether it's acceptable to runtime suspend a device. Earlier this validation was made to know whether it was okay to invoke the ->stop() callback for the device, hence the governor used the name "stop_ok" for the related variables. To clarify the code around this, let's rename these variables from "stop_ok" to "suspend_ok". Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'Makefile')