Python SDK /fastsim.planner

fastsim.planner

8 个类

Abstract planner interface for motion planning backends. Implement Planner to integrate a custom IK/FK/motion-plan solver. CuroboPlanner provides a ready-to-use GPU-accelerated implementation.

class

Planner

抽象类7 个方法
fastsim.planner.planner.Planner继承自ABC

Abstract base class for all planners (arm and navigation). Provides minimal shared interface.

Planner defines the shared interface for both ArmPlanner (manipulator planning) and NavigationPlanner (mobile base planning). Subclasses implement update_world() and get_world_representation(). For arm-specific methods (solve_ik, gen_motion_plan, etc.), see ArmPlanner. For navigation methods (plan_path, compute_velocity, etc.), see NavigationPlanner.

solve_ikmethod
def solve_ik(self, base_frame_ee_pose: list, is_goal_set: bool = False, retract_joint_position: list | None = None)dict

Solve inverse kinematics for a target EE pose.

参数名类型默认值说明
base_frame_ee_poselistTarget EE pose [x, y, z, qw, qx, qy, qz].
is_goal_setoptboolFalseWhether a motion goal has already been set in the planner state.
retract_joint_positionoptlist|NoneNoneOptional retract seed for singularity avoidance.
dict — Joint position solution dict.
solve_fkmethod
def solve_fk(self, joint_positions: list, joint_names: list)dict

Compute forward kinematics for a joint configuration.

参数名类型默认值说明
joint_positionslistJoint position values.
joint_nameslistCorresponding joint names.
dict — End-effector pose dict.
gen_motion_planmethod
def gen_motion_plan(self, start_state: dict, base_frame_ee_pose: list, is_goal_set: bool = False)dict

Generate a collision-free joint trajectory.

参数名类型默认值说明
start_statedictStarting joint state dict.
base_frame_ee_poselistGoal EE pose.
is_goal_setoptboolFalseWhether the planner goal is pre-set.
dict — Planned trajectory dict.
attach_objectsmethod
def attach_objects(self, joint_state: dict, object_prim_paths: list, link_name: str, attach_offset: list)None

Register attached objects in the planner collision model.

参数名类型默认值说明
joint_statedictCurrent joint state at time of attachment.
object_prim_pathslistUSD prim paths of objects to attach.
link_namestrRobot link name for the attachment.
attach_offsetlistPose offset [x, y, z, qw, qx, qy, qz] from the link.
detach_objectsmethod
def detach_objects(self, link_name: str)None

Remove attached objects from the planner collision model.

参数名类型默认值说明
link_namestrThe link name from which to detach.
get_plannable_joint_namesmethod
def get_plannable_joint_names(self)list

Return the list of joints this planner controls.

list — List of plannable joint name strings.
get_locked_jointmethod
def get_locked_joint(self)list

Return joints excluded from planning (locked).

list — List of locked joint name strings.
class

CuroboPlanner

2 个方法
fastsim.planner.curobo_planner.CuroboPlanner继承自ArmPlanner

GPU-accelerated arm motion planner backed by the cuRobo library.

CuroboPlanner implements all Planner abstract methods using cuRobo's batched IK, FK, and motion-generation solvers. Requires a CUDA-capable GPU.

get_world_representationmethod
def get_world_representation(self)Any

Return the cuRobo world collision model (voxel or mesh).

Any — cuRobo world representation object.
get_robot_representationmethod
def get_robot_representation(self)Any

Return the cuRobo robot self-collision model.

Any — cuRobo robot representation object.
继承自ArmPlanner4
solve_ikmethod
def solve_ik(self, base_frame_ee_pose: Any)dict

Solve inverse kinematics for one or more target EE poses.

gen_motion_planmethod
def gen_motion_plan(self, start_state: dict, base_frame_ee_pose: Any)dict

Generate a collision-free trajectory to the target EE pose.

attach_objectsmethod
def attach_objects(self, joint_state: dict, object_prim_paths: list)bool

Attach objects to the robot model in the planner world.

detach_objectsmethod
def detach_objects(self)

Detach previously attached objects from the planner world.

class

OmplPlanner

0 个方法
fastsim.planner.ompl_planner.OmplPlanner继承自ArmPlanner

CPU-based arm motion planner using the Open Motion Planning Library (OMPL) with PyBullet collision checking.

OmplPlanner reads collision geometry from SceneManager and uses PyBullet for collision detection. Does not require a GPU. Works with all simulator backends.

继承自ArmPlanner4
solve_ikmethod
def solve_ik(self, base_frame_ee_pose: Any)dict

Solve inverse kinematics for one or more target EE poses.

gen_motion_planmethod
def gen_motion_plan(self, start_state: dict, base_frame_ee_pose: Any)dict

Generate a collision-free trajectory to the target EE pose.

attach_objectsmethod
def attach_objects(self, joint_state: dict, object_prim_paths: list)bool

Attach objects to the robot model in the planner world.

detach_objectsmethod
def detach_objects(self)

Detach previously attached objects from the planner world.

class

ArmPlanner

抽象类4 个方法
fastsim.planner.arm_planner.ArmPlanner继承自Planner

Abstract base for manipulator arm planners (IK, FK, motion planning, attach/detach).

ArmPlanner extends Planner with arm-specific abstract methods. CuroboPlanner and OmplPlanner both inherit from this class.

solve_ikmethod
def solve_ik(self, base_frame_ee_pose: Any)dict

Solve inverse kinematics for one or more target EE poses.

参数名类型默认值说明
base_frame_ee_poseAnyTarget EE pose(s) in base frame.
dict — IK solution dict with joint positions.
gen_motion_planmethod
def gen_motion_plan(self, start_state: dict, base_frame_ee_pose: Any)dict

Generate a collision-free trajectory to the target EE pose.

参数名类型默认值说明
start_statedictCurrent joint state.
base_frame_ee_poseAnyTarget EE pose(s).
dict — Motion plan with joint trajectory.
attach_objectsmethod
def attach_objects(self, joint_state: dict, object_prim_paths: list)bool

Attach objects to the robot model in the planner world.

参数名类型默认值说明
joint_statedictCurrent joint state.
object_prim_pathslistPrim paths of objects to attach.
bool — True if attachment succeeded.
detach_objectsmethod
def detach_objects(self)

Detach previously attached objects from the planner world.

继承自Planner7
solve_ikmethod
def solve_ik(self, base_frame_ee_pose: list, is_goal_set: bool = False, retract_joint_position: list | None = None)dict

Solve inverse kinematics for a target EE pose.

solve_fkmethod
def solve_fk(self, joint_positions: list, joint_names: list)dict

Compute forward kinematics for a joint configuration.

gen_motion_planmethod
def gen_motion_plan(self, start_state: dict, base_frame_ee_pose: list, is_goal_set: bool = False)dict

Generate a collision-free joint trajectory.

attach_objectsmethod
def attach_objects(self, joint_state: dict, object_prim_paths: list, link_name: str, attach_offset: list)None

Register attached objects in the planner collision model.

detach_objectsmethod
def detach_objects(self, link_name: str)None

Remove attached objects from the planner collision model.

get_plannable_joint_namesmethod
def get_plannable_joint_names(self)list

Return the list of joints this planner controls.

get_locked_jointmethod
def get_locked_joint(self)list

Return joints excluded from planning (locked).

class

NavigationPlanner

抽象类5 个方法
fastsim.planner.navigation_planner.NavigationPlanner继承自Planner

Abstract base for mobile base navigation planners (path planning, velocity control).

NavigationPlanner extends Planner with navigation-specific methods: plan_path, compute_velocity, set_goal, cancel, is_goal_reached. The A*+DWA planner is the built-in implementation.

plan_pathmethod
def plan_path(self, start: Any, goal: Any)Any

Plan a path from start to goal on the 2D ground plane.

参数名类型默认值说明
startAnyStart pose (Pose2D: x, y, theta).
goalAnyGoal pose (Pose2D: x, y, theta).
Any — NavigationResult with success flag and path.
compute_velocitymethod
def compute_velocity(self, current_pose: Any, current_velocity: Any)Any

Compute the next velocity command (DWA local planning).

参数名类型默认值说明
current_poseAnyCurrent Pose2D.
current_velocityAnyCurrent Twist2D.
Any — Twist2D velocity command.
set_goalmethod
def set_goal(self, goal: Any)bool

Set the navigation goal and plan a path.

参数名类型默认值说明
goalAnyGoal Pose2D.
bool — True if path was found.
is_goal_reachedmethod
def is_goal_reached(self, pos_tolerance: float = 0.05, angle_tolerance: float = 0.1)bool

Check if the robot has reached the goal within tolerance.

参数名类型默认值说明
pos_toleranceoptfloat0.05
angle_toleranceoptfloat0.1
bool — True if goal reached.
cancelmethod
def cancel(self)

Cancel the current navigation goal.

继承自Planner7
solve_ikmethod
def solve_ik(self, base_frame_ee_pose: list, is_goal_set: bool = False, retract_joint_position: list | None = None)dict

Solve inverse kinematics for a target EE pose.

solve_fkmethod
def solve_fk(self, joint_positions: list, joint_names: list)dict

Compute forward kinematics for a joint configuration.

gen_motion_planmethod
def gen_motion_plan(self, start_state: dict, base_frame_ee_pose: list, is_goal_set: bool = False)dict

Generate a collision-free joint trajectory.

attach_objectsmethod
def attach_objects(self, joint_state: dict, object_prim_paths: list, link_name: str, attach_offset: list)None

Register attached objects in the planner collision model.

detach_objectsmethod
def detach_objects(self, link_name: str)None

Remove attached objects from the planner collision model.

get_plannable_joint_namesmethod
def get_plannable_joint_names(self)list

Return the list of joints this planner controls.

get_locked_jointmethod
def get_locked_joint(self)list

Return joints excluded from planning (locked).

class

AStarDWAPlanner

0 个方法
fastsim.planner.planners.astar_dwa.astar_dwa_planner.AStarDWAPlanner继承自NavigationPlanner

A*+DWA hybrid navigation planner for mobile bases.

Combines A* global path planning on an occupancy grid with Dynamic Window Approach (DWA) local velocity optimization. Builds occupancy grid from scene objects or sensor data. Config: AStarDWAPlannerConfig now extends NavigationPlannerConfig.

继承自NavigationPlanner5
plan_pathmethod
def plan_path(self, start: Any, goal: Any)Any

Plan a path from start to goal on the 2D ground plane.

compute_velocitymethod
def compute_velocity(self, current_pose: Any, current_velocity: Any)Any

Compute the next velocity command (DWA local planning).

set_goalmethod
def set_goal(self, goal: Any)bool

Set the navigation goal and plan a path.

is_goal_reachedmethod
def is_goal_reached(self, pos_tolerance: float = 0.05, angle_tolerance: float = 0.1)bool

Check if the robot has reached the goal within tolerance.

cancelmethod
def cancel(self)

Cancel the current navigation goal.

class

CuroboMpcNavigationPlanner

0 个方法
fastsim.planner.planners.curobo_mpc_nav.curobo_mpc_nav_planner.CuroboMpcNavigationPlanner继承自NavigationPlanner

GPU MPC navigation planner. Walks an executable_path of rotate / translate sub-poses; uses curobo MpcSolver per tick.

Refreshes both A*-based occupancy grid and curobo world on update_world. Lazy-initializes MpcSolver / WorldConfig / robot handle on first use. Writes joint position targets (3 base joints) directly via compute_velocity instead of returning a Twist2D. Stereotype: curobo_mpc_nav.

继承自NavigationPlanner5
plan_pathmethod
def plan_path(self, start: Any, goal: Any)Any

Plan a path from start to goal on the 2D ground plane.

compute_velocitymethod
def compute_velocity(self, current_pose: Any, current_velocity: Any)Any

Compute the next velocity command (DWA local planning).

set_goalmethod
def set_goal(self, goal: Any)bool

Set the navigation goal and plan a path.

is_goal_reachedmethod
def is_goal_reached(self, pos_tolerance: float = 0.05, angle_tolerance: float = 0.1)bool

Check if the robot has reached the goal within tolerance.

cancelmethod
def cancel(self)

Cancel the current navigation goal.

class

PlannerFactory

静态类1 个方法
fastsim.planner.planner_factory.PlannerFactory

Static factory for creating Planner instances from a config dict.

createstaticmethod
@staticmethod def create(robot_name: str, config: dict)Planner

Instantiate a Planner for a given robot name and config.

参数名类型默认值说明
robot_namestrName of the robot this planner will control.
configdictPlanner configuration dict specifying type and parameters.
Planner — Constructed Planner instance.