COPP C ABI
C interface for COPP trajectory optimization
Loading...
Searching...
No Matches
Copp_topp2

Files

file  bindings/c/include/copp/topp2.h
 TOPP2-RA and second-order reachable-set APIs.

Data Structures

struct  Topp2RaOptions
 Options for TOPP2-RA reachability analysis. More...
struct  CoppReachSet2Result
 Reachable intervals returned by TOPP2 reachable-set construction. More...

Functions

enum CoppStatus topp2_ra_default_options (struct Topp2RaOptions *out_options)
 Write default TOPP2-RA options into out_options.
enum CoppStatus topp2_ra (struct Topp2Problem problem, struct Topp2RaOptions options, struct CoppVecF64 *out_a)
 Solve a TOPP2-RA problem.
enum CoppStatus copp_reach_set2_backward (struct Topp2Problem problem, struct Topp2RaOptions options, struct CoppReachSet2Result *out_result)
 Compute backward-only TOPP2 reachable intervals.
enum CoppStatus copp_reach_set2_bidirectional (struct Topp2Problem problem, struct Topp2RaOptions options, struct CoppReachSet2Result *out_result)
 Compute bidirectional TOPP2 reachable intervals.
void copp_reach_set2_result_free (struct CoppReachSet2Result result)
 Release a reachable-set result returned by COPP.

Detailed Description

Function Documentation

◆ topp2_ra_default_options()

enum CoppStatus topp2_ra_default_options ( struct Topp2RaOptions * out_options)

Write default TOPP2-RA options into out_options.

Warning
Safety out_options must be valid for one Topp2RaOptions write.

◆ topp2_ra()

enum CoppStatus topp2_ra ( struct Topp2Problem problem,
struct Topp2RaOptions options,
struct CoppVecF64 * out_a )

Solve a TOPP2-RA problem.

On success, out_a owns a COPP-allocated vector containing the solved a(s) = (ds/dt)^2 profile over the closed station interval and must be released with copp_vec_f64_free.

Example

The example below solves a TOPP2-RA problem and releases the returned a(s) profile.

struct Topp2RaOptions options;
struct Topp2Problem problem = {robot, 0, n - 1, 0.0, 0.0};
struct CoppVecF64 a = {0};
check(topp2_ra_default_options(&options));
check(topp2_ra(problem, options, &a));
void copp_vec_f64_free(struct CoppVecF64 vec)
Release a library-owned f64 vector returned by COPP.
enum CoppStatus topp2_ra_default_options(struct Topp2RaOptions *out_options)
Write default TOPP2-RA options into out_options.
enum CoppStatus topp2_ra(struct Topp2Problem problem, struct Topp2RaOptions options, struct CoppVecF64 *out_a)
Solve a TOPP2-RA problem.
Library-owned f64 vector returned to C.
Definition core.h:828
Borrowed value descriptor for a TOPP2 problem solved from C.
const struct CoppRobot * robot
Robot handle that owns the station-indexed constraint storage.
Options for TOPP2-RA reachability analysis.
Definition topp2.h:31
Warning
Safety problem.robot must be a non-null handle returned by copp_robot_create and must remain valid for the duration of this call. The robot must not be freed or mutated concurrently during the solve. out_a must be valid for one CoppVecF64 write.

◆ copp_reach_set2_backward()

enum CoppStatus copp_reach_set2_backward ( struct Topp2Problem problem,
struct Topp2RaOptions options,
struct CoppReachSet2Result * out_result )

Compute backward-only TOPP2 reachable intervals.

This performs the same backward pass as reach_set2_backward: the terminal boundary a_final is enforced, while the start boundary is only checked for basic feasibility and is not imposed by a forward clipping pass.

On success, out_result owns two vectors with length idx_s_final - idx_s_start + 1, ordered as a_max then a_min. Release them with copp_reach_set2_result_free.

Example

The example below computes backward-only reachable intervals for a TOPP2 problem.

struct Topp2RaOptions options;
struct Topp2Problem problem = {robot, 0, n - 1, 0.0, 0.0};
struct CoppReachSet2Result reach = {0};
check(topp2_ra_default_options(&options));
check(copp_reach_set2_backward(problem, options, &reach));
void copp_reach_set2_result_free(struct CoppReachSet2Result result)
Release a reachable-set result returned by COPP.
enum CoppStatus copp_reach_set2_backward(struct Topp2Problem problem, struct Topp2RaOptions options, struct CoppReachSet2Result *out_result)
Compute backward-only TOPP2 reachable intervals.
Reachable intervals returned by TOPP2 reachable-set construction.
Definition topp2.h:97
Warning
Safety problem.robot must be a non-null handle returned by copp_robot_create and must remain valid for the duration of this call. The robot must not be freed or mutated concurrently. out_result must be valid for one CoppReachSet2Result write.

◆ copp_reach_set2_bidirectional()

enum CoppStatus copp_reach_set2_bidirectional ( struct Topp2Problem problem,
struct Topp2RaOptions options,
struct CoppReachSet2Result * out_result )

Compute bidirectional TOPP2 reachable intervals.

This performs a backward pass followed by a forward clipping pass, enforcing both boundary values a_start and a_final.

On success, out_result owns two vectors with length idx_s_final - idx_s_start + 1, ordered as a_max then a_min. Release them with copp_reach_set2_result_free.

Example

The example below computes bidirectional reachable intervals while enforcing both endpoint boundary values.

struct Topp2RaOptions options;
struct CoppReachSet2Result reach = {0};
check(topp2_ra_default_options(&options));
check(copp_reach_set2_bidirectional(problem, options, &reach));
enum CoppStatus copp_reach_set2_bidirectional(struct Topp2Problem problem, struct Topp2RaOptions options, struct CoppReachSet2Result *out_result)
Compute bidirectional TOPP2 reachable intervals.
Warning
Safety problem.robot must be a non-null handle returned by copp_robot_create and must remain valid for the duration of this call. The robot must not be freed or mutated concurrently. out_result must be valid for one CoppReachSet2Result write.

◆ copp_reach_set2_result_free()

void copp_reach_set2_result_free ( struct CoppReachSet2Result result)

Release a reachable-set result returned by COPP.

Warning
Safety result must either be empty/null or have been returned by a successful copp_reach_set2_backward / copp_reach_set2_bidirectional call. Passing arbitrary pointers or modified capacity fields is invalid.