amino  1.0-beta2
Lightweight Robot Utility Library
scene_fk.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) 2019, Colorado School of Mines
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or
8  * without modification, are permitted provided that the following
9  * conditions are met:
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above
13  * copyright notice, this list of conditions and the following
14  * disclaimer in the documentation and/or other materials provided
15  * with the distribution.
16  * * Neither the name of copyright holder the names of its
17  * contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21  * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
22  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
28  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  */
35 
36 #ifndef AMINO_SCENE_FK_H
37 #define AMINO_SCENE_FK_H
38 
39 #include "scenegraph.h"
40 #include "rxtype.h"
41 
51 struct aa_rx_fk;
52 
56 AA_API struct aa_rx_fk *
57 aa_rx_fk_alloc(const struct aa_rx_sg *scene_graph, struct aa_mem_region *reg);
58 
62 AA_API struct aa_rx_fk *
63 aa_rx_fk_malloc(const struct aa_rx_sg *scene_graph);
64 
68 AA_API void
69 aa_rx_fk_cpy(struct aa_rx_fk *dst, const struct aa_rx_fk *src);
70 
72 AA_API double *
73 aa_rx_fk_data( const struct aa_rx_fk *fk );
74 
76 AA_API size_t
77 aa_rx_fk_ld( const struct aa_rx_fk *fk );
78 
80 AA_API size_t
81 aa_rx_fk_cnt( const struct aa_rx_fk *fk );
82 
86 AA_API void
87 aa_rx_fk_destroy(struct aa_rx_fk * fk);
88 
92 AA_API void
93 aa_rx_fk_all( struct aa_rx_fk *fk,
94  const struct aa_dvec *q );
95 
99 AA_API double *
100 aa_rx_fk_ref(const struct aa_rx_fk *fk, aa_rx_frame_id id);
101 
105 AA_API void
106 aa_rx_fk_get_abs_qutr(const struct aa_rx_fk *fk, aa_rx_frame_id id, double E[7]);
107 
111 AA_API void
112 aa_rx_fk_get_rel_qutr(const struct aa_rx_fk *fk,
113  aa_rx_frame_id parent, aa_rx_frame_id child,
114  double E[7]);
115 
116 
120 AA_API void
121 aa_rx_fk_set_rel(struct aa_rx_fk *fk, aa_rx_frame_id id, const double E[AA_RX_TF_LEN]);
122 
126 AA_API void
127 aa_rx_fk_rot_abs( const struct aa_rx_fk *fk, aa_rx_frame_id id,
128  const double *v_id, double *v_abs );
129 
130 #endif /*AMINO_SCENE_FK_H*/
#define AA_API
calling and name mangling convention for functions
Definition: amino.h:95
Scenegraph-related type declarations.
#define AA_RX_TF_LEN
Number of elements in a transform.
Definition: rxtype.h:46
AA_API struct aa_rx_fk * aa_rx_fk_malloc(const struct aa_rx_sg *scene_graph)
Heap allocate a forward kinematics struct.
AA_API void aa_rx_fk_destroy(struct aa_rx_fk *fk)
Destroy a malloc'ed struct aa_rx_fk.
AA_API void aa_rx_fk_rot_abs(const struct aa_rx_fk *fk, aa_rx_frame_id id, const double *v_id, double *v_abs)
Rotate a point to absolute coordinates.
AA_API void aa_rx_fk_get_abs_qutr(const struct aa_rx_fk *fk, aa_rx_frame_id id, double E[7])
Copy an absolute TF out of fk.
AA_API void aa_rx_fk_cpy(struct aa_rx_fk *dst, const struct aa_rx_fk *src)
Copy a forward kinematics struct.
AA_API double * aa_rx_fk_data(const struct aa_rx_fk *fk)
Pointer to FK data.
AA_API void aa_rx_fk_all(struct aa_rx_fk *fk, const struct aa_dvec *q)
Compute the forward kinematics.
AA_API size_t aa_rx_fk_cnt(const struct aa_rx_fk *fk)
Number of frames in the FK.
AA_API double * aa_rx_fk_ref(const struct aa_rx_fk *fk, aa_rx_frame_id id)
Reference to internal storage for a transform.
AA_API void aa_rx_fk_get_rel_qutr(const struct aa_rx_fk *fk, aa_rx_frame_id parent, aa_rx_frame_id child, double E[7])
Copy a relative TF out of fk.
AA_API struct aa_rx_fk * aa_rx_fk_alloc(const struct aa_rx_sg *scene_graph, struct aa_mem_region *reg)
Region allocate a forward kinematics struct.
AA_API void aa_rx_fk_set_rel(struct aa_rx_fk *fk, aa_rx_frame_id id, const double E[AA_RX_TF_LEN])
Update relative transform in the FK.
AA_API size_t aa_rx_fk_ld(const struct aa_rx_fk *fk)
Leading dimension of FK data.
The scenegraph data structure.
signed long aa_rx_frame_id
Type for frame indices.
Definition: scenegraph.h:54
Descriptor for a vector.
Definition: mat.h:63
Data Structure for Region-Based memory allocation.
Definition: mem.h:199
Opaque type for a scene_graph.