A Flutter application for controlling a paintball robot with keyboard input and real-time camera viewing.
-
Keyboard Control:
W- Move forwardS- Move backwardA- Move leftD- Move rightQ- Rotate leftE- Rotate rightSHIFT- Move upCTRL- Move downF- Continuous shootingG- Punch actionT- Get up (when robot falls)R- Reset head position
-
Mouse Control:
- Right mouse drag - Head pan/tilt control
- Left mouse click - Single shot
-
Real-time Camera: Live video feed from robot camera
-
Robot Status Display: HP and armor indicators with visual feedback
-
Hit Effects: Red overlay effect when taking damage
-
Velocity Charts: Real-time display of linear and angular velocities
-
ROS Integration: WebSocket connection to ROS system
- Make sure you have Flutter installed
- Clone the repository
- Navigate to the project directory
- Run the following commands:
flutter pub get
flutter run-
Edit the
lib/assets/config.yamlfile:- Set the robot's IP address
- Configure ROS Bridge ports
- Specify required ROS topics
-
When starting the application, enter the ROS Bridge port (usually 9090)
lib/
├── main.dart # Main application file
├── main_page.dart # Main page with robot control
├── globals.dart # Global variables
├── ros_service.dart # ROS service for WebSocket
├── assets/
│ ├── config.yaml # Configuration file
│ └── AiNexCL.png # Robot image
└── pages/
├── camera.dart # Camera module
└── keyboard_controller.dart # Keyboard control module
└── widgets/
└── crosshair_overlay.dart # Crosshair overlay widget
- Flutter 3.0+
- ROS with rosbridge_server
- WebSocket connection to the robot
- Robot with camera and control systems
- Start the application
- Select robot type from dropdown
- Enter ROS Bridge port
- Click START
- Use keyboard keys to control the robot
- Use mouse for head control and shooting
- Monitor robot status (HP/Armor) and camera feed
- Health System: Robot has HP (1000) and Armor (200)
- Damage System: Taking hits reduces armor first, then HP
- Death State: When HP reaches 0, robot locks and resets head position
- Visual Feedback: Red overlay effect when taking damage
- Reset Function: Restore full HP and armor
web_socket_channel: For WebSocket connectionyaml: For configuration file handlingfl_chart: For velocity charts displayflutter/material: For UI components
- WASD: Classic movement (W/S - Forward/Backward, A/D - Left/Right)
- Q/E: Rotate Left/Right
- SHIFT/CTRL: Up/Down movement
- F: Hold for continuous shooting
- G: Punch action
- T: Get up when robot falls
- R: Reset head position
- Right Mouse Drag: Head pan/tilt control
- Left Mouse Click: Single shot
- Real-time WebSocket communication with ROS
- Compressed image streaming from robot camera
- Velocity data visualization with charts
- Responsive UI with status indicators
- Cross-platform support (Web, Desktop, Mobile)