rtd.planner.trajopt.GenericArmObjective

class rtd.planner.trajopt.GenericArmObjective(trajOptProps: ~rtd.planner.trajopt.TrajOptProps.TrajOptProps, trajectoryFactory: <module 'rtd.planner.trajectory.TrajectoryFactory' from '/rtd/rtd/planner/trajectory/TrajectoryFactory.py'>)[source]

Bases: Objective

__init__(trajOptProps: ~rtd.planner.trajopt.TrajOptProps.TrajOptProps, trajectoryFactory: <module 'rtd.planner.trajectory.TrajectoryFactory' from '/rtd/rtd/planner/trajectory/TrajectoryFactory.py'>)[source]

Constructs this objective function generator. Provide a trajectory factory object which creates unique trajectory objects with each call and the properties of the overall trajopt problem, from which the time for the cost is used with some trajectory to create the objective

Parameters:
  • trajOptProps – TrajOptProps

  • trajectoryFactory – TrajectoryFactory

Methods

__init__(trajOptProps, trajectoryFactory)

Constructs this objective function generator.

evalTrajectory(trajectoryParams, ...)

Helper function purely accessible to this class without any class state which a handle can be made to to evaluate the trajectory for the cost.

genObjective(robotState, waypoint, reachableSets)

Generate an objective callback for use with some optimizer

static evalTrajectory(trajectoryParams: ~nptyping.ndarray.NDArray[~nptyping.base_meta_classes.Shape[N], ~numpy.float64], trajectoryObj: <module 'rtd.planner.trajectory.Trajectory' from '/rtd/rtd/planner/trajectory/Trajectory.py'>, q_des, t_cost: float | ~nptyping.ndarray.NDArray[~nptyping.base_meta_classes.Shape[N], ~numpy.float64]) float[source]

Helper function purely accessible to this class without any class state which a handle can be made to to evaluate the trajectory for the cost. Should work for any generic arm trajectory in joint space

genObjective(robotState: EntityState, waypoint, reachableSets: dict[str, rtd.planner.reachsets.ReachSetInstance.ReachSetInstance]) Callable[source]

Generate an objective callback for use with some optimizer

Given the information, generate a handle for an objective function with return values cost and grad_cost

Note

Any timeouts should be handled by the OptimizationEngine itself

Parameters:
  • robotState – Initial state of the robot

  • waypoint – Some goal waypoint we want to get close to

  • reachableSets – Instances of the relevant reachable sets

Returns:

callback function of form def objectiveCallback(*params) -> [cost, grad_cost]

Return type:

function_handle