summaryrefslogtreecommitdiff
path: root/LocomotorPrimitivesController.h
blob: 68bf1af6662eb1a5b5c5067d2fea0657edddebb8 (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
#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;

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

#endif /* LOCOMOTORPRIMITIVES_CONTROLLER_H_ */
b6148f4e07853b876ef73bc69ca'>diff)
ARM: EXYNOS: Properly skip unitialized parent clock in power domain on
We want to skip reparenting a clock on turning on power domain, if we do not have the parent yet. The parent is obtained when turning the domain off. However due to a typo, the loop is continued on IS_ERR() of clock being reparented, not on the IS_ERR() of the parent. Theoretically this could lead to OOPS on first turn on of a power domain, if there was no turn off before. Practically that should never happen because all power domains are turned on by default (reset value, bootloader does not turn off them usually) so the first action will be always turn off. Fixes: 29e5eea06bc1 ("ARM: EXYNOS: Get current parent clock for power domain on/off") Reported-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Diffstat (limited to 'Documentation')