A comprehensive textbook covering the fundamental and advanced concepts of Physical AI and Humanoid Robotics, from ROS 2 fundamentals to Visual Language-Action (VLA) models.
This textbook provides a structured learning path for students and practitioners interested in robotics, artificial intelligence, and human-robot interaction. It covers the complete spectrum of humanoid robotics, from basic communication frameworks to advanced AI-powered decision making.
Learn the Robot Operating System 2 (ROS 2), the foundational framework for robot software development.
Chapters:
Topics Covered:
Master robotic simulation environments for developing and testing robotic systems without physical hardware.
Chapters:
Topics Covered:
Explore the artificial intelligence aspects of robotics, including perception, navigation, and manipulation.
Chapters:
Topics Covered:
Discover the cutting-edge intersection of large language models, computer vision, and robotic action.
Chapters:
Topics Covered:
# Install ROS 2 Humble (recommended)
sudo apt update
sudo apt install ros-humble-desktop
pip install numpy opencv-python cv-bridge
# Install dependencies
npm install
# Start development server
npm run start
# Build the documentation
npm run build
# Serve locally
npm run serve
Each module includes hands-on lab exercises:
After completing this textbook, you will be able to:
Contributions are welcome! Please read our contributing guidelines before submitting pull requests.
This textbook is for educational purposes.
This project includes a FastAPI backend with an intelligent RAG Agent for the Physical AI Textbook chatbot.
/chat - Normal chat query/chat-with-context - Contextual chat with selected text# Navigate to backend
cd backend
python -m venv venv
venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Copy and configure environment
cp .env.example .env
# Add your API keys to .env
# Start the server
uvicorn src.main:app --reload --port 8000
| Endpoint | Method | Description |
|---|---|---|
/health |
GET | Health check |
/chat |
POST | Normal chat query |
/chat-with-context |
POST | Contextual chat with selected text |
# Health check
curl http://localhost:8000/health
# Normal chat
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"question": "What is ROS2?"}'
# Contextual chat
curl -X POST http://localhost:8000/chat-with-context \
-H "Content-Type: application/json" \
-d '{"question": "Explain this", "selected_text": "ROS2 is the next generation of ROS"}'
| Variable | Description |
|---|---|
OPENAI_API_KEY |
OpenAI API key for GPT model |
COHERE_API_KEY |
Cohere API key for embeddings |
QDRANT_URL |
Qdrant server URL |
QDRANT_API_KEY |
Qdrant API key |
QDRANT_COLLECTION |
Vector collection name (default: physical-ai-textbook) |
backend/
├── src/
│ ├── main.py # FastAPI application
│ ├── config.py # Settings loader
│ ├── api/
│ │ └── routes.py # API endpoints
│ ├── agents/
│ │ └── rag_agent.py # RAG agent logic
│ ├── services/
│ │ ├── embedding.py # Cohere embedding client
│ │ └── retrieval.py # Qdrant retrieval
│ └── models/
│ └── schemas.py # Pydantic models
└── requirements.txt # Python dependencies
Ingest documents into the Qdrant vector database for the RAG chatbot.
# Navigate to backend
cd backend
# Activate virtual environment
venv\Scripts\activate
# Prepare documents
# Place .txt or .md files in ./data/docs/
# Run ingestion (API-limit-safe)
python scripts/ingest_qdrant.py
# Or use legacy script
python scripts/ingest_book.py
The ingestion script:
./data/docs/physical-ai-textbook| Variable | Description |
|---|---|
COHERE_API_KEY |
Cohere API key for embeddings |
QDRANT_URL |
Qdrant server URL |
QDRANT_API_KEY |
Qdrant API key |
QDRANT_COLLECTION |
Collection name (default: physical-ai-textbook) |
DOCS_PATH |
Path to docs folder (default: ./data/docs) |
Integrate the RAG chatbot with the Docusaurus documentation site for interactive Q&A about the textbook.
# Start Docusaurus
cd docusaurus
npm start
Add the Chatbot to your pages using the wrapper:
// In your page or layout
import Chatbot from '@site/src/components/Chatbot';
export default function MyLayout({ children }) {
return (
<>
{children}
<Chatbot />
</>
);
}
Or use the wrapper component:
import ChatbotWrapper from '@site/src/components/Chatbot/wrappers/ChatbotWrapper';
export default function MyPage() {
return (
<ChatbotWrapper>
<YourPageContent />
</ChatbotWrapper>
);
}
Edit docusaurus/src/components/Chatbot/config.ts to configure:
API_BASE_URL: Backend URL (default: http://localhost:8000)TIMEOUTS.REQUEST: Request timeout (default: 10s)DIMENSIONS.*: UI dimensionsdocusaurus/src/components/Chatbot/
├── index.tsx # Main component
├── ChatWindow.tsx # Chat interface
├── FloatingButton.tsx # Toggle button
├── MessageList.tsx # Message display
├── styles.module.css # Styling
├── types/index.ts # TypeScript types
├── config.ts # Configuration
├── services/
│ └── api.ts # API service
├── hooks/
│ ├── useChat.ts # Chat state
│ ├── useTheme.ts # Theme detection
│ └── useTextSelection.ts # Text selection
├── components/
│ └── SelectionButton.tsx # "Ask AI" button
└── wrappers/
└── ChatbotWrapper.tsx # Page wrapper
| Endpoint | Method | Description |
|---|---|---|
/chat |
POST | Normal chat query |
/chat-with-context |
POST | Chat with selected text |
Version: 1.0 Last Updated: 2026