GCOPTER Trajectory Optimizer

repository·main·Indexed 23 days ago

https://github.com/zju-fast-lab/gcopter

A high-performance multicopter trajectory optimizer utilizing MINCO sparse trajectory representation for real-time, geometrically constrained motion planning. It supports complex dynamics including nonlinear drag effects, non-uniform MINCO variants, and fast iterative region inflation (FIRI) for corridor generation. The project includes a ROS-based GlobalPlanner node for kinodynamic trajectory planning and mockamap, a synthetic environment generator for robotics testing.

Tokens
1.5K
Snippets
1
Records
6
Agent score
29%

What's inside GCOPTER

  1. What is GCOPTER and MINCO?

    main

    GCOPTER is an efficient and versatile multicopter trajectory optimizer. It is built upon MINCO, a novel sparse trajectory representation.

    Key features include:

    • Dynamic Constraints: Supports user-defined state-input constraints for dynamics involving nonlinear drag effects.
    • MINCO Variants: Supports non-uniform MINCO for $s=2$, $s=3$, and $s=4$.
    • Corridor Generation: Includes modules for fast iterative region inflation (FIRI) for corridor generation.
  2. Install GCOPTER for Global Trajectory Planning

    main

    To run the global trajectory planning example, you need to install system dependencies, set the CPU governor to performance mode, and build the project within a ROS workspace.

    Prerequisites:

    • ROS (Robot Operating System) installed and configured.
    • libompl-dev for motion planning.
    • cpufrequtils for CPU performance management.

    Installation Steps:

    1. Update system and install dependencies.
    2. Set CPU to performance mode.
    3. Create a ROS workspace, clone the repository, and build using catkin_make.
    4. Source the workspace and launch the global planning node.
    sudo apt update
    sudo apt install cpufrequtils
    sudo apt install libompl-dev
    sudo cpufreq-set -g performance
    mkdir ROS; cd ROS; mkdir src; cd src
    git clone https://github.com/ZJU-FAST-Lab/GCOPTER.git
    cd ..
    catkin_make
    source devel/setup.bash
    roslaunch gcopter global_planning.launch
  3. Use the Global Trajectory Planning Example

    main

    The global trajectory planning example provides real-time high-quality corridor and trajectory generation subject to dynamic constraints.

    Usage in RViz:

    • Relative Height: The angle between the arrow of the 2D Nav Goal and the positive x-axis (red axis) determines the relative height of the goal.
    • Triggering Planning: You can repeat the selection of start and goal points to trigger new global planning cycles.
    • Observing Results: The solution considers spatial-temporal optimality and vehicle dynamics (including drag effects). You can monitor states like net thrust, tilt angle, and body rate using rqt_plot.

    Customization:

    • Physical Parameters: All physical parameters in standard units are modifiable in the configuration file.
    • Performance Optimization: To achieve faster computing by using a point-mass model instead of full multicopter dynamics, modify the penalty-functional-relevant code.
  4. Understand the GlobalPlanner workflow

    main

    The GlobalPlanner operates through a continuous loop of map updates, target acquisition, and trajectory processing:

    1. Map Initialization: The planner subscribes to a MapTopic (sensor_msgs/PointCloud2). Upon receiving the first valid point cloud, it populates a VoxelMap and applies dilation based on DilateRadius.
    2. Target Acquisition: The planner subscribes to a TargetTopic (geometry_msgs/PoseStamped). When a new target is received, it calculates a safe zGoal based on the map bounds and dilation, then attempts to plan a path from the current position to this goal.
    3. Trajectory Planning:
      • Generates a path using sfc_gen::planPath.
      • Creates a convex cover using sfc_gen::convexCover and simplifies it with sfc_gen::shortCut.
      • Optimizes a kinodynamic trajectory using gcopter::GCOPTER_PolytopeSFC subject to physical constraints (velocity, tilt, thrust, etc.).
    4. Trajectory Execution/Processing: The process() method tracks the elapsed time since the trajectory was generated. It uses a FlatnessMap to map the trajectory's state (velocity, acceleration, jerk) back to vehicle control inputs (thrust, quaternion, body rates) and publishes these to the visualizer.
  5. Configure the GlobalPlanner ROS node

    main

    The GlobalPlanner is a ROS-based node for kinodynamic trajectory planning. It is configured using ROS parameters via the Config struct. When running the node, you must provide these parameters to define the environment, vehicle physics, and planning constraints.

    ROS Parameter Keys

    ParameterTypeDescription
    MapTopicstringThe topic for incoming sensor_msgs/PointCloud2 map data.
    TargetTopicstringThe topic for incoming geometry_msgs/PoseStamped target poses.
    DilateRadiusdoubleRadius used to dilate the voxel map for safety.
    VoxelWidthdoubleThe size of each voxel in the map.
    MapBounddouble[6]The bounding box of the map: [x_min, x_max, y_min, y_max, z_min, z_max].
    TimeoutRRTdoubleTimeout for the RRT planning process.
    MaxVelMagdoubleMaximum allowable velocity magnitude.
    MaxBdrMagdoubleMaximum allowable body rate magnitude.
    MaxTiltAngledoubleMaximum allowable tilt angle.
    MinThrustdoubleMinimum allowable thrust.
    MaxThrustdoubleMaximum allowable thrust.
    VehicleMassdoubleMass of the vehicle.
    GravAccdoubleGravitational acceleration.
    HorizDragdoubleHorizontal drag coefficient.
    VertDragdoubleVertical drag coefficient.
    ParasDragdoubleParasitic drag coefficient.
    SpeedEpsdoubleSpeed smoothing factor.
    WeightTdoubleWeight for the time parameter in optimization.
    ChiVecdouble[5]Penalty weights for [pos, vel, omg, theta, thrust].
    SmoothingEpsdoubleSmoothing epsilon for trajectory optimization.
    IntegralIntervsintNumber of quadrature intervals for integration.
    RelCostToldoubleRelative cost tolerance for optimization.