A modern web-based interface for recording ROS2 bag files. This tool provides an intuitive UI for managing ROS2 bag recordings, selecting topics, and downloading recorded data.
Note: This project was developed with the assistance of AI tools to accelerate development and implement best practices.
http://localhost:8080)# Install dependencies
source ~/.nvm/nvm.sh && npm install
# Start development server
source ~/.nvm/nvm.sh && npm run dev
The application will be available at http://localhost:3000
# Development server with hot reload
npm run dev
# Type checking
npm run type-check
# Linting
npm run lint
# Production build
npm run build
# Preview production build
npm run preview
src/
âââ api/
â âââ client.ts # API client for backend communication
â âââ types.ts # TypeScript type definitions
âââ components/
â âââ BatchActions.tsx # Bulk operations UI
â âââ RecordingControls.tsx # Start/stop recording controls
â âââ StatusDisplay.tsx # Connection and recording status
â âââ TopicSelector.tsx # Multi-select topic interface
âââ hooks/
â âââ useRecording.ts # Recording state management (HTTP polling)
â âââ useWebSocket.ts # WebSocket connection logic (prepared, not active)
âââ App.tsx # Main application component
âââ main.tsx # Application entry point
The frontend connects to a backend service that handles actual ROS2 bag recording operations.
GET /api/topics - Retrieve available ROS2 topicsGET /api/status - Get current recording statusPOST /api/start - Start a new recordingPOST /api/stop - Stop current recordingGET /api/recordings - List all recorded bag filesGET /api/download/:filename - Download a specific recordingPOST /api/batch/download - Batch download multiple recordings (returns ZIP)DELETE /api/recordings/:filename - Delete a recordingPOST /api/batch/delete - Batch delete multiple recordingsWS /ws - Real-time status updates (prepared but not currently used)Note: The frontend currently uses HTTP polling (every 3 seconds) for status updates. WebSocket support is implemented in the code but disabled, as the backend may not yet support it. To enable WebSocket, uncomment the WebSocket code in src/hooks/useRecording.ts (lines 61-118).
The frontend expects the backend at http://localhost:8080 by default. This can be configured in vite.config.ts under the proxy settings.
A Dockerfile is provided for containerized deployment:
# Build the image
docker build -t bag-recorder-frontend .
# Run the container
docker run -p 80:80 bag-recorder-frontend
The Docker setup includes:
Note: WebSocket proxy is configured but the frontend currently uses HTTP polling.
Edit vite.config.ts to change the backend server location:
server: {
proxy: {
'/api': {
target: 'http://localhost:8080', // Change this
changeOrigin: true,
secure: false
},
'/ws': {
target: 'ws://localhost:8080', // Change this
ws: true,
changeOrigin: true
}
}
}
Change the development server port in vite.config.ts:
server: {
port: 3000, // Change this
host: true
}
This is a development tool designed for robotics engineers working with ROS2. It prioritizes functionality and ease of use over complex deployment scenarios. The application is intended to run locally alongside ROS2 development environments.
http://localhost:8080vite.config.ts/api/status endpoint is workingThis is a development tool for personal/team use. Contributions are welcome for bug fixes and feature enhancements that maintain the project's focus on simplicity and usability.
MIT
This project was developed with AI assistance to implement modern web development best practices and accelerate the development process.