Skip to main content

Advanced AI Prompts for Chapter 3

Use these prompts with AI assistants to get help with advanced costmap configuration, planner tuning, reinforcement learning, and sim-to-real transfer.


Costmap Configuration

Layer Configuration

Explain the interaction between static, obstacle, and inflation layers in Nav2 costmaps.
How do they combine to produce the final cost values?

Inflation Tuning

I have a robot with 0.5m diameter. What inflation_radius should I use?
Explain the relationship between robot size, inflation radius, and safety margins.

Custom Costmap Layers

How do I create a custom costmap layer plugin for Nav2?
Show me the basic structure and required methods.

Global vs Local Costmap Differences

What parameters should differ between global and local costmaps?
Explain the trade-offs in update frequency, size, and resolution.

Costmap Performance Optimization

My costmaps are updating too slowly. What parameters affect performance?
How do I balance accuracy with computational cost?

Multi-Layer Fusion

How does Nav2 combine multiple costmap layers?
Explain the cost combination algorithm and priority handling.

Dynamic Reconfiguration

Can I change costmap parameters at runtime? Show me how to
dynamically reconfigure inflation radius or update frequency.

Planner Configuration

Global Planner Comparison

Compare A*, Dijkstra, Theta*, and Smac Planner for Nav2.
When should I use each? What are the trade-offs?

A* Heuristic Tuning

Explain the heuristic function in A* planning.
How does it affect optimality and computation time?

DWA Parameter Tuning

My DWA local planner is too conservative/aggressive. What parameters
control this behavior? Explain velocity limits, trajectory scoring, and obstacle costs.

TEB Planner Configuration

When should I use TEB (Timed Elastic Band) instead of DWA?
What are the key parameters to tune?

MPPI Controller

Explain the MPPI (Model Predictive Path Integral) controller.
What advantages does it offer? When should I use it?

Planner Switching

Can I switch between planners at runtime based on the situation?
How would I implement adaptive planner selection?

Kinematic Constraints

How do I configure planners to respect my robot's kinematic constraints
(max velocity, acceleration, turning radius)?

Behavior Trees

Behavior Tree Structure

Explain the structure of Nav2's behavior tree.
What are the main nodes and how do they coordinate navigation?

Custom Behavior Nodes

How do I create a custom behavior tree node for Nav2?
Show me the plugin structure and registration process.

Recovery Behavior Configuration

What recovery behaviors are available in Nav2?
How do I configure their order and parameters?

Behavior Tree Debugging

My behavior tree isn't executing as expected. How do I debug it?
What tools or logging can help visualize execution?

State Machine vs Behavior Tree

When should I use a behavior tree vs a traditional state machine
for robot control? What are the trade-offs?

Parallel Execution

How do behavior trees handle parallel execution of multiple behaviors?
Show me an example of concurrent navigation and monitoring.

Reinforcement Learning

MDP Formulation

Help me formulate robot navigation as an MDP (Markov Decision Process).
What are the states, actions, rewards, and transition dynamics?

Reward Function Design

Design a reward function for training a robot to navigate to a goal
while avoiding obstacles. What should be rewarded/penalized?

PPO Algorithm Explanation

Explain the PPO (Proximal Policy Optimization) algorithm in detail.
What is the clipped objective? Why does it improve stability?

PPO vs SAC Comparison

Compare PPO and SAC (Soft Actor-Critic) for robot control tasks.
When should I use each? What are the sample efficiency differences?

Policy Network Architecture

What neural network architecture should I use for a navigation policy?
Explain input features, hidden layers, and output actions.

Value Function Approximation

Explain value function approximation in RL.
What's the difference between state value (V) and action value (Q)?

Exploration Strategies

What exploration strategies work well for robot learning?
Explain epsilon-greedy, entropy regularization, and curiosity-driven exploration.

Training Stability

My RL training is unstable with high variance. What techniques
improve stability? Explain baseline subtraction, advantage estimation, and normalization.

Curriculum Learning

How do I implement curriculum learning for robot tasks?
Start with simple scenarios and gradually increase difficulty.

Off-Policy vs On-Policy

Explain the difference between on-policy (PPO) and off-policy (SAC) RL.
What are the implications for sample efficiency and stability?

Sim-to-Real Transfer

Reality Gap Analysis

What are the main sources of the reality gap between simulation and real robots?
How do physics, sensors, and actuators differ?

Domain Randomization Strategy

Design a domain randomization strategy for training a navigation policy.
What parameters should I randomize? What ranges are appropriate?

System Identification

How do I perform system identification to make my simulation more accurate?
What robot parameters should I measure and tune?

Sensor Noise Modeling

How do I add realistic sensor noise to my Gazebo simulation?
What noise models are appropriate for cameras, LIDAR, and IMU?

Physics Simulation Accuracy

What Gazebo physics parameters affect sim-to-real transfer?
How do I tune friction, damping, and contact parameters?

Robust Policy Training

How do I train policies that are robust to sim-to-real differences?
Explain techniques beyond domain randomization.

ONNX Model Export

Show me how to export a trained PyTorch/TensorFlow policy to ONNX format.
Include quantization and optimization steps.

Loading ONNX in ROS 2

Write a ROS 2 node that loads an ONNX model and executes it for inference.
Include input preprocessing and output postprocessing.

Validation Protocol

Design a validation protocol for testing sim-to-real transfer.
What metrics should I measure? How do I ensure safety?

Deployment Pipeline

Outline the complete pipeline from training in simulation to deploying
on a real robot. What are the critical steps and checkpoints?

Advanced Debugging

Costmap Visualization Analysis

My costmap shows unexpected behavior. Walk me through systematic analysis:
What should I check in each layer? How do I isolate issues?

Planner Failure Diagnosis

Navigation fails in specific scenarios. How do I diagnose whether
it's a global planner, local planner, or costmap issue?

TF Performance Issues

My TF lookups are slow and causing delays. How do I optimize TF performance?
What are common bottlenecks?

Memory Leaks in Perception

My perception node's memory usage grows over time. How do I identify
and fix memory leaks in image processing pipelines?

Real-Time Constraint Violations

My system occasionally misses real-time deadlines. How do I profile
and optimize for consistent real-time performance?

Production Deployment

Safety Systems

What safety systems should I implement before deploying autonomous navigation
on a real robot? Include emergency stops, watchdogs, and fail-safes.

Monitoring & Diagnostics

Design a monitoring system for production robot deployment.
What metrics should I track? How do I detect anomalies?

Graceful Degradation

How do I implement graceful degradation when sensors fail or
navigation becomes unreliable? Design a fault-tolerant architecture.

Performance Benchmarking

What benchmarks should I run to validate navigation performance?
Include metrics for accuracy, speed, safety, and robustness.

Configuration Management

How should I manage configurations for different environments
(lab, warehouse, outdoor)? Best practices for parameter organization.

Advanced Algorithms

Particle Filter Localization

Explain particle filter localization in detail.
How does it differ from Kalman filter approaches?

Graph-Based SLAM

What is graph-based SLAM? How does it differ from filter-based SLAM?
Explain pose graphs and optimization.

Semantic SLAM

What is semantic SLAM? How does it incorporate object recognition
into mapping and localization?

Multi-Robot SLAM

How do I extend SLAM to multiple robots? What are the challenges
in distributed mapping and localization?

Deep Learning for Perception

How can I integrate deep learning models (object detection, segmentation)
into my perception pipeline? Architecture and performance considerations.

Research & Advanced Topics

Imitation Learning

Explain imitation learning for robotics. How does it differ from RL?
When should I use behavioral cloning vs inverse RL?

Meta-Learning for Adaptation

What is meta-learning and how can it help robots adapt quickly
to new environments? Explain MAML and related approaches.

Uncertainty Quantification

How do I quantify uncertainty in perception and planning?
Explain Bayesian approaches and ensemble methods.

Sim-to-Real via Domain Adaptation

Explain domain adaptation techniques for sim-to-real transfer.
How do adversarial training and feature alignment help?

End-to-End Learning

What are the trade-offs of end-to-end learning (pixels to actions)
vs modular pipelines (perception → planning → control)?

Optimization Techniques

Hyperparameter Tuning

What's the best approach for tuning Nav2 hyperparameters?
Should I use grid search, random search, or Bayesian optimization?

Multi-Objective Optimization

I need to optimize for both speed and safety in navigation.
How do I handle multi-objective optimization? Pareto frontiers?

Online Learning

Can my robot continue learning and improving during deployment?
What are safe online learning strategies?

Transfer Learning

I trained a policy in one environment. How do I transfer it to
a different environment? What techniques preserve learned knowledge?

Integration Patterns

Perception-Planning Integration

Design the interface between perception and planning systems.
What information should perception provide? How should it be formatted?

Multi-Modal Sensor Fusion

How do I fuse camera, LIDAR, and IMU data for robust perception?
Explain early fusion vs late fusion approaches.

Hierarchical Planning

Design a hierarchical planning system with high-level task planning
and low-level motion planning. How do they communicate?

Learning-Based Planning

How do I integrate learned policies with traditional planners?
When should the robot use learning vs classical planning?

Tips for Using These Prompts

  • Provide Context: Mention your robot platform, sensors, and environment
  • Share Data: Include parameter files, error logs, or performance metrics
  • Ask for Trade-offs: Request analysis of different approaches
  • Request Papers: Ask for relevant research papers for deep dives
  • Iterate Solutions: Start with basic approach, then optimize

Advanced Learning Resources

When AI assistants reference these, ask for explanations:

  • Papers: "Explain the key ideas from [paper name] in simple terms"
  • Algorithms: "Walk me through [algorithm] step by step with an example"
  • Math: "Explain the intuition behind [equation] without heavy math"
  • Code: "Show me a minimal implementation of [concept]"

Remember: Advanced topics require deep understanding. Don't hesitate to ask for multiple explanations from different angles until concepts click.


Previous: Intermediate AI Prompts