Fawkes API Fawkes Development Version
types.h
1
2/***************************************************************************
3 * types.h - Definition of types for Kinova Jaco Plugin
4 *
5 * Created: Thu Jun 13 19:14:20 2013
6 * Copyright 2013 Bahram Maleki-Fard
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#ifndef _PLUGINS_JACO_TYPES_H_
25#define _PLUGINS_JACO_TYPES_H_
26
27#include <core/utils/refptr.h>
28
29#include <list>
30#include <string>
31#include <vector>
32
33class JacoGotoThread;
37
38namespace fawkes {
39
40class Mutex;
41class JacoArm;
42class JacoInterface;
43class JacoBimanualInterface;
44
45/// \brief A trajectory point
46typedef std::vector<float> jaco_trajec_point_t;
47/// \brief A trajectory
48typedef std::vector<jaco_trajec_point_t> jaco_trajec_t;
49
50/// \brief The setup-configuration of the arm
52 CONFIG_SINGLE, /**< we only have one arm. */
53 CONFIG_LEFT, /**< this arm is the left one out of two. */
54 CONFIG_RIGHT /**< this arm is the right one out of two. */
56
57/// \brief The type of a target
59 TARGET_CARTESIAN, /**< target with cartesian coordinates. */
60 TARGET_ANGULAR, /**< target with angular coordinates. */
61 TARGET_GRIPPER, /**< only gripper movement. */
62 TARGET_READY, /**< target is the READY position of the Jaco arm. */
63 TARGET_RETRACT /**< target is the RETRACT position of the Jaco arm. */
65
66/// \brief The state of a trajectory
68 TRAJEC_SKIP, /**< skip trajectory planning for this target. */
69 TRAJEC_WAITING, /**< new trajectory target, wait for planner to process. */
70 TRAJEC_PLANNING, /**< planner is planning the trajectory. */
71 TRAJEC_READY, /**< trajectory has been planned and is ready for execution. */
72 TRAJEC_EXECUTING, /**< trajectory is being executed. */
73 TRAJEC_IK_ERROR, /**< planner could not find IK solution for target */
74 TRAJEC_PLANNING_ERROR /**< planner could not plan a collision-free trajectory. */
76
77/// \brief Jaco target struct, holding information on a target.
79{
80 jaco_target_type_t type; /**< target type. */
81 jaco_trajec_point_t pos; /**< target position (interpreted depending on target type). */
82 jaco_trajec_point_t fingers; /**< target finger values. */
83 fawkes::RefPtr<jaco_trajec_t> trajec; /**< trajectory, if target is TARGET_TRAJEC. */
84 jaco_trajec_state_t trajec_state; /**< state of the trajectory, if target is TARGET_TRAJEC. */
85 bool coord; /**< this target needs to be coordinated with targets of other arms. */
87
88/// \brief FIFO target queue, holding RefPtr to targets.
89typedef std::list<RefPtr<jaco_target_t>> jaco_target_queue_t;
90
91/// \brief Jaco struct containing all components required for one arm
92typedef struct jaco_arm_struct
93{
94 jaco_arm_config_t config; /**< configuration for this arm */
95 fawkes::JacoArm * arm; /**< pointer to actual JacoArm instance, controlling this arm */
96 JacoInterface * iface; /**< pointer to JacoInterface, assigned to this arm */
97
98 JacoGotoThread * goto_thread; /**< the GotoThread of this arm. */
99 JacoOpenraveThread *openrave_thread; /**< the OpenraveThread of this arm. */
100
101 RefPtr<Mutex> target_mutex; /**< mutex, used for accessing the target_queue */
103 trajec_mutex; /**< mutex, used for modifying trajectory of a target. Only locked shortly. */
104
105 RefPtr<jaco_target_queue_t> target_queue; /**< queue of targets, which is processed FIFO. */
106
107 float
108 trajec_color[4]; /**< the color used for plotting the trajectory. RGBA values, each from 0-1. */
109} jaco_arm_t;
110
111/// \brief Jaco struct containing all components required for a dual-arm setup
113{
114 jaco_arm_t * left; /**< the struct with all the data for the left arm. */
115 jaco_arm_t * right; /**< the struct with all the data for the right arm. */
116 JacoBimanualInterface * iface; /**< interface used for coordinated manipulation. */
117 JacoBimanualGotoThread * goto_thread; /**< GotoThread for coordinated manipulation. */
118 JacoBimanualOpenraveThread *openrave_thread; /**< OpenraveThread for coordinated manipulation. */
120
121} // end namespace fawkes
122
123#endif
Jaco Arm movement thread.
Jaco Arm thread for dual-arm setup, integrating OpenRAVE.
Jaco Arm movement thread.
Definition: goto_thread.h:44
Jaco Arm thread for single-arm setup, integrating OpenRAVE.
Abstract class for a Kinova Jaco Arm that we want to control.
Definition: arm.h:36
JacoBimanualInterface Fawkes BlackBoard Interface.
JacoInterface Fawkes BlackBoard Interface.
Definition: JacoInterface.h:34
Fawkes library namespace.
enum fawkes::jaco_arm_config_enum jaco_arm_config_t
The setup-configuration of the arm.
enum fawkes::jaco_trajec_state_enum jaco_trajec_state_t
The state of a trajectory.
struct fawkes::jaco_target_struct_t jaco_target_t
Jaco target struct, holding information on a target.
enum fawkes::jaco_target_type_enum jaco_target_type_t
The type of a target.
struct jaco_arm_struct jaco_arm_t
Jaco struct containing all components required for one arm.
Definition: act_thread.h:33
jaco_target_type_enum
The type of a target.
Definition: types.h:58
@ TARGET_READY
target is the READY position of the Jaco arm.
Definition: types.h:62
@ TARGET_GRIPPER
only gripper movement.
Definition: types.h:61
@ TARGET_CARTESIAN
target with cartesian coordinates.
Definition: types.h:59
@ TARGET_RETRACT
target is the RETRACT position of the Jaco arm.
Definition: types.h:63
@ TARGET_ANGULAR
target with angular coordinates.
Definition: types.h:60
std::vector< float > jaco_trajec_point_t
A trajectory point.
Definition: types.h:46
std::vector< jaco_trajec_point_t > jaco_trajec_t
A trajectory.
Definition: types.h:48
struct jaco_dual_arm_struct jaco_dual_arm_t
Jaco struct containing all components required for a dual-arm setup.
jaco_arm_config_enum
The setup-configuration of the arm.
Definition: types.h:51
@ CONFIG_SINGLE
we only have one arm.
Definition: types.h:52
@ CONFIG_LEFT
this arm is the left one out of two.
Definition: types.h:53
@ CONFIG_RIGHT
this arm is the right one out of two.
Definition: types.h:54
jaco_trajec_state_enum
The state of a trajectory.
Definition: types.h:67
@ TRAJEC_WAITING
new trajectory target, wait for planner to process.
Definition: types.h:69
@ TRAJEC_READY
trajectory has been planned and is ready for execution.
Definition: types.h:71
@ TRAJEC_IK_ERROR
planner could not find IK solution for target
Definition: types.h:73
@ TRAJEC_PLANNING
planner is planning the trajectory.
Definition: types.h:70
@ TRAJEC_PLANNING_ERROR
planner could not plan a collision-free trajectory.
Definition: types.h:74
@ TRAJEC_EXECUTING
trajectory is being executed.
Definition: types.h:72
@ TRAJEC_SKIP
skip trajectory planning for this target.
Definition: types.h:68
std::list< RefPtr< jaco_target_t > > jaco_target_queue_t
FIFO target queue, holding RefPtr to targets.
Definition: types.h:89
Jaco struct containing all components required for one arm.
Definition: types.h:93
jaco_arm_config_t config
configuration for this arm
Definition: types.h:94
float trajec_color[4]
the color used for plotting the trajectory.
Definition: types.h:108
JacoGotoThread * goto_thread
the GotoThread of this arm.
Definition: types.h:98
fawkes::JacoArm * arm
pointer to actual JacoArm instance, controlling this arm
Definition: types.h:95
JacoOpenraveThread * openrave_thread
the OpenraveThread of this arm.
Definition: types.h:99
RefPtr< Mutex > trajec_mutex
mutex, used for modifying trajectory of a target.
Definition: types.h:103
RefPtr< Mutex > target_mutex
mutex, used for accessing the target_queue
Definition: types.h:101
RefPtr< jaco_target_queue_t > target_queue
queue of targets, which is processed FIFO.
Definition: types.h:105
JacoInterface * iface
pointer to JacoInterface, assigned to this arm
Definition: types.h:96
Jaco struct containing all components required for a dual-arm setup.
Definition: types.h:113
JacoBimanualInterface * iface
interface used for coordinated manipulation.
Definition: types.h:116
JacoBimanualGotoThread * goto_thread
GotoThread for coordinated manipulation.
Definition: types.h:117
jaco_arm_t * right
the struct with all the data for the right arm.
Definition: types.h:115
JacoBimanualOpenraveThread * openrave_thread
OpenraveThread for coordinated manipulation.
Definition: types.h:118
jaco_arm_t * left
the struct with all the data for the left arm.
Definition: types.h:114
Jaco target struct, holding information on a target.
Definition: types.h:79
fawkes::RefPtr< jaco_trajec_t > trajec
trajectory, if target is TARGET_TRAJEC.
Definition: types.h:83
jaco_trajec_point_t fingers
target finger values.
Definition: types.h:82
bool coord
this target needs to be coordinated with targets of other arms.
Definition: types.h:85
jaco_trajec_point_t pos
target position (interpreted depending on target type).
Definition: types.h:81
jaco_target_type_t type
target type.
Definition: types.h:80
jaco_trajec_state_t trajec_state
state of the trajectory, if target is TARGET_TRAJEC.
Definition: types.h:84