amino
Lightweight Robot Utility Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
traj.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_TRAJ_H
39 #define AMINO_CT_TRAJ_H
40 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
52 struct aa_ct_pt {
53  struct aa_ct_state state;
54  struct aa_ct_pt *prev, *next;
55 };
56 
60 struct aa_ct_pt_list;
61 
65 struct aa_ct_seg_list;
66 
67 
75 struct aa_ct_pt_list *aa_ct_pt_list_create(struct aa_mem_region *reg);
76 
84 void aa_ct_pt_list_add(struct aa_ct_pt_list *list, struct aa_ct_state *state);
85 
91 void aa_ct_pt_list_destroy(struct aa_ct_pt_list *list);
92 
99 void aa_ct_pt_list_dump(FILE *stream, struct aa_ct_pt_list *list);
100 
111 int aa_ct_seg_list_eval(struct aa_ct_seg_list *list, struct aa_ct_state *state,
112  double t);
113 
121 void aa_ct_seg_list_plot(struct aa_ct_seg_list *list, size_t n_q, double dt);
122 
128 void aa_ct_seg_list_destroy(struct aa_ct_seg_list *list);
129 
130 
140 struct aa_ct_seg_list *aa_ct_tjq_pb_generate(struct aa_mem_region *reg,
141  struct aa_ct_pt_list *list,
142  struct aa_ct_state *limits);
143 
153 struct aa_ct_seg_list *aa_ct_tjX_pb_generate(struct aa_mem_region *reg,
154  struct aa_ct_pt_list *list,
155  struct aa_ct_state *limits);
156 #ifdef __cplusplus
157 }
158 #endif
159 
160 #endif
State description of a robot.
Definition: state.h:52
Waypoint.
Definition: traj.h:52
struct aa_ct_state state
Description of state at waypoint.
Definition: traj.h:53
struct aa_ct_seg_list * aa_ct_tjq_pb_generate(struct aa_mem_region *reg, struct aa_ct_pt_list *list, struct aa_ct_state *limits)
Generate a parabolic blend trajectory from a point list.
struct aa_ct_seg_list * aa_ct_tjX_pb_generate(struct aa_mem_region *reg, struct aa_ct_pt_list *list, struct aa_ct_state *limits)
Generate a parabolic blend trajectory from a point list.
void aa_ct_pt_list_destroy(struct aa_ct_pt_list *list)
Destroys an allocated point list.
struct aa_ct_pt_list * aa_ct_pt_list_create(struct aa_mem_region *reg)
Initialize and construct a point list from a memory region.
void aa_ct_seg_list_plot(struct aa_ct_seg_list *list, size_t n_q, double dt)
Plots a segment list with a given resolution.
Data Structure for Region-Based memory allocation.
Definition: mem.h:197
struct aa_ct_pt * next
Links to next and previous points.
Definition: traj.h:54
void aa_ct_seg_list_destroy(struct aa_ct_seg_list *list)
Destroys an allocated segment list.
int aa_ct_seg_list_eval(struct aa_ct_seg_list *list, struct aa_ct_state *state, double t)
Evaluates a segment list at a given time.
void aa_ct_pt_list_dump(FILE *stream, struct aa_ct_pt_list *list)
Print out a list of points to a file.
void aa_ct_pt_list_add(struct aa_ct_pt_list *list, struct aa_ct_state *state)
Add a reference to a waypoint to a point list.