amino  1.0-beta2
Lightweight Robot Utility Library
state.h
Go to the documentation of this file.
1 /* -*- mode: C; c-basic-offset: 4; -*- */
2 /* ex: set shiftwidth=4 tabstop=4 expandtab: */
3 /*
4  * Copyright (c) 2016, Rice University
5  * All rights reserved.
6  *
7  * Author(s): Zachary K. Kingston <zak@rice.edu>
8  *
9  * Redistribution and use in source and binary forms, with or
10  * without modification, are permitted provided that the following
11  * conditions are met:
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of copyright holder the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
27  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
30  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
31  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 
38 #ifndef AMINO_CT_STATE_H
39 #define AMINO_CT_STATE_H
40 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
52 struct aa_ct_state {
53  size_t n_q;
54  size_t n_tf;
55 
56  // Joint space
57  double *q;
58  double *dq;
59  double *ddq;
60  double *eff;
61 
62  // Work space
63  double *X;
64  double *dX;
65  double *ddX;
66 
67  // Frames
68  double *TF_abs;
69  double *TF_rel;
70 };
71 
75 struct aa_ct_limit {
76  struct aa_ct_state *min;
78  struct aa_ct_state *max;
79 };
80 
84 AA_API struct aa_ct_state *
85 aa_ct_state_alloc(struct aa_mem_region *reg, size_t n_q, size_t n_tf );
86 
94 void aa_ct_state_clone(struct aa_mem_region *reg, struct aa_ct_state *dest,
95  struct aa_ct_state *src);
96 
97 
98 
105 void aa_ct_state_dump(FILE *stream, struct aa_ct_state *state);
106 
115 int aa_ct_state_eq(struct aa_ct_state *s1, struct aa_ct_state *s2);
116 
117 
118 void aa_ct_state_set_qutr( struct aa_ct_state *state, const double E[7] );
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /*AMINO_CT_STATE_H*/
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95
void aa_ct_state_dump(FILE *stream, struct aa_ct_state *state)
Prints out the jointspace components of a state.
void aa_ct_state_clone(struct aa_mem_region *reg, struct aa_ct_state *dest, struct aa_ct_state *src)
Creates and allocates a copy of a state.
AA_API struct aa_ct_state * aa_ct_state_alloc(struct aa_mem_region *reg, size_t n_q, size_t n_tf)
Allocate state from a memory region.
int aa_ct_state_eq(struct aa_ct_state *s1, struct aa_ct_state *s2)
Compares two states to verify if they are the same, within AA_EPSILON bounds.
Limits on robot state.
Definition: state.h:75
struct aa_ct_state * min
The minimum limit values Dq and ddq should be negative.
Definition: state.h:76
struct aa_ct_state * max
The maximum limit values.
Definition: state.h:78
State description of a robot.
Definition: state.h:52
size_t n_tf
Number of frames.
Definition: state.h:54
double * X
Position (Quaterion-Vector)
Definition: state.h:63
double * TF_rel
Relative frame transforms.
Definition: state.h:69
double * ddX
Acceleration (Acceleration / Rotation Vector)
Definition: state.h:65
double * ddq
Acceleration.
Definition: state.h:59
double * dq
Velocity.
Definition: state.h:58
double * dX
Velocity (Velocity / Rotation Vector)
Definition: state.h:64
double * q
Position.
Definition: state.h:57
double * TF_abs
Absolute frame transforms.
Definition: state.h:68
double * eff
Efforts.
Definition: state.h:60
size_t n_q
Number of configuration variables.
Definition: state.h:53
Data Structure for Region-Based memory allocation.
Definition: mem.h:199