gremsy_camera
Gremsy gimbal/camera control over MAVLink for Dart and Flutter.
Features
- UDP MAVLink transport
- Gimbal control (angle + speed)
- Camera control (capture, record)
- EO/IR switching and zoom modes
- Object tracking helpers
Platform support
- Tested on Android with Gremsy payloads
- Uses
dart:iosockets, so web is not supported
Setup
- You need a MAVLink route from your app to the Gremsy payload (direct Wi-Fi/ethernet or through your vehicle).
- Use the payload IP/port that accepts MAVLink. If unsure, confirm in your payload configuration.
- This package uses
dart:iosockets (no web support).
Quick start
import 'package:gremsy_camera/gremsy_camera.dart';
final gremsy = GremsyClient(
host: '192.168.144.119',
port: 14566,
localPort: 14566,
);
await gremsy.connect();
await gremsy.switchStreamMode(StreamMode.eo);
await gremsy.setGimbalAngle(yaw: 0, pitch: -10);
await gremsy.zoomIn();
Common operations
await gremsy.recordStart();
await Future.delayed(const Duration(seconds: 2));
await gremsy.recordStop();
await gremsy.captureImage();
await gremsy.setGimbalSpeed(yawRate: 10, pitchRate: -5);
await gremsy.centerGimbal();
Gremsy D-pad movement
gremsy.increaseGremsyGimbalSpeed(); // 5 deg/s steps, clamped to 5-60.
await gremsy.pressGimbalDirection(GremsyGimbalDirection.right);
gremsy.keepGimbalSpeedAlive(); // Call every 120ms while the pointer is down.
await gremsy.releaseGimbalDirection(GremsyGimbalDirection.right);
Manual speed movement sends repeated speed commands while active. Release and reset use a zero-speed stop burst so the gimbal halts reliably after long holds.
Tracking helpers
await gremsy.prepareTracking(TrackingType.trained);
await gremsy.sendTrackAt(
tapX: 200,
tapY: 120,
viewW: 640,
viewH: 360,
);
// later...
await gremsy.stopTracking();
Cleanup
await gremsy.disconnect(); // Allows reconnecting later.
await gremsy.dispose(); // Final cleanup; closes state streams.
State updates
gremsy.stateStream.listen((state) {
// Read zoom, tracking, recording, and gimbal status info.
});
Troubleshooting
- Call
await gremsy.connect()before sending commands. Commands throw aStateErrorwhen no UDP transport is open. - On Android, make sure the app has network permission and the device is on the same network as the Gremsy payload.
- Confirm the payload IP, target port, and local port in the Gremsy or vehicle network configuration. Some payloads expect MAVLink on a fixed local UDP port.
- If commands are routed through a flight controller or companion computer, verify that MAVLink forwarding includes the camera, gimbal, and payload component ids.
- If tracking telemetry does not update, confirm that the MAVLink route allows PARAM/PARAM_EXT traffic from the payload back to the app.
Notes
- This package is not affiliated with Gremsy.
- Ensure your payload is configured to accept MAVLink commands.
Libraries
- gremsy_camera
- A Flutter package to control Gremsy cameras and gimbals via MAVLink.