File: Object.hpp

package info (click to toggle)
blender 4.3.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 309,564 kB
  • sloc: cpp: 2,385,210; python: 330,236; ansic: 280,972; xml: 2,446; sh: 972; javascript: 317; makefile: 170
file content (52 lines) | stat: -rw-r--r-- 1,306 bytes parent folder | download
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
43
44
45
46
47
48
49
50
51
52
/* SPDX-FileCopyrightText: 2009 Ruben Smits
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later */

/** \file
 * \ingroup intern_itasc
 */

#ifndef OBJECT_HPP_
#define OBJECT_HPP_

#include "Cache.hpp"
#include "kdl/frames.hpp"
#include <string>

namespace iTaSC{

class WorldObject;

class Object {
public:
    enum ObjectType {Controlled, UnControlled};
	static WorldObject world;

private:
    ObjectType m_type;
protected:
	Cache *m_cache;
	KDL::Frame m_internalPose;
	bool m_updated;
    virtual void updateJacobian()=0;
public:
    Object(ObjectType _type):m_type(_type), m_cache(NULL), m_internalPose(F_identity), m_updated(false) {};
    virtual ~Object(){};

	virtual int addEndEffector(const std::string&  /*name*/){return 0;};
	virtual bool finalize(){return true;};
	virtual const KDL::Frame& getPose(const unsigned int end_effector=0){
		(void)end_effector;
		return m_internalPose;
	};
    virtual const ObjectType getType(){return m_type;};
    virtual const unsigned int getNrOfCoordinates(){return 0;};
    virtual void updateKinematics(const Timestamp& /*timestamp*/)=0;
    virtual void pushCache(const Timestamp& /*timestamp*/)=0;
	virtual void initCache(Cache * /*cache*/) = 0;
	bool updated() {return m_updated;};
	void updated(bool val) {m_updated=val;};
};

}
#endif /* OBJECT_HPP_ */