Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter controller v2 #464

Open
wants to merge 75 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
d21727f
creating flutter project working both ios and android
sparsh3dwe Dec 15, 2022
58a15e5
creating main page
sparsh3dwe Dec 16, 2022
6f3910c
completed ui of controller application
Dec 20, 2022
8848506
add onpress on main screen
Dec 20, 2022
d73af10
controller arrow icon styling change
Dec 20, 2022
bff1a8b
added function to accelerator in Drive by tilting by phone
nitishpratap18 Dec 20, 2022
6770e7d
mergin drive by tilting mode
nitishpratap18 Dec 20, 2022
fb08558
set slider value -1 to 1
Dec 21, 2022
693b02d
added log to client and create client new global variable
nitishpratap18 Dec 21, 2022
31f7eef
change client socket variables
Dec 21, 2022
6e38930
made filter function for data send to openBot
nitishpratap18 Dec 22, 2022
c8ec7d8
fixed zitter in Drive by tilting mode
nitishpratap18 Dec 22, 2022
bb67529
set slider value, slider cmd send to client, indicator and switch com…
Dec 22, 2022
c659248
indicator button blink when indicator on
Dec 23, 2022
612627d
set accelerometer value in tilt phone mode
Dec 23, 2022
5bbfdc6
set ui of forward and reverse button in tilting phone mode
Dec 26, 2022
1c26545
change socket service name
Dec 26, 2022
d1803fe
set ui of select controller shadow
Dec 26, 2022
e1583d8
send command to openBot App issue solved
Dec 29, 2022
c31e298
Merge branch 'isl-org:master' into flutter-controller
sparsh3dwe Jan 3, 2023
97f2f79
videoViewWebRTC
Jan 5, 2023
1ee4862
peer connection successful
Jan 6, 2023
698c4f4
video rendering done in webrtc
Jan 10, 2023
d888130
video view set on controll selector in fit to full screen
Jan 12, 2023
c268240
video view is set on all screen
Jan 12, 2023
0266ce0
implement change mirror view, add toast message, disable back button,…
Jan 12, 2023
65715fc
update service name
Jan 13, 2023
3ef8a56
updating readme file and updating command on drive mode
sparsh3dwe Jan 13, 2023
2bfa9ff
removing extra logs and adding screenshots
sparsh3dwe Jan 13, 2023
37c42eb
reformatting code
sparsh3dwe Jan 13, 2023
2513726
removing extra code
sparsh3dwe Jan 13, 2023
be7202a
removing warnings and extra code
sparsh3dwe Jan 13, 2023
aedeaa9
creating constants to store common msgs and renaming some files
sparsh3dwe Jan 13, 2023
19bb952
add toast message for RTSP video server
Jan 14, 2023
eeada17
renaming file import
sparsh3dwe Jan 20, 2023
f3e1392
renaming app ids
sparsh3dwe Jan 20, 2023
ff3a8d8
remove unnecessary logs and upgrade java 11
Jan 23, 2023
51926c6
upgrade java version
Jan 23, 2023
6f032d3
remove logs
Jan 23, 2023
5b42b2e
Merge branch 'isl-org:master' into flutter-controller
sparsh3dwe Feb 16, 2023
cedb9b2
formatting
sparsh3dwe Feb 16, 2023
bd1bc50
Merge branch 'isl-org:master' into flutter-controller
sparsh3dwe Feb 24, 2023
99c826a
Merge branch 'isl-org:master' into flutter-controller
sparsh3dwe Mar 3, 2023
1df61f3
Merge branch 'isl-org:master' into flutter-controller
sparsh3dwe Mar 5, 2023
1fd9cb4
Merge branch 'isl-org:master' into flutter-controller
sparsh3dwe Apr 3, 2023
b703732
Merge branch 'isl-org:master' into flutter-controller
sparsh3dwe Apr 7, 2023
3d691ea
Merge branch 'isl-org:master' into flutter-controller
sparsh3dwe Apr 9, 2023
db27790
upgrade webrtc library
Jun 17, 2023
5592fa2
get server of openBot and set drop down button in control selector sc…
Jun 20, 2023
03a66c5
set server name in drop down button and send server name to openBot o…
Jun 20, 2023
12e156a
server choose using openBot controller app in autopilot fragment
Jun 21, 2023
ae67b00
fixed ios data channeling issue
Dec 5, 2023
9ef8ced
Merge branch 'master' into flutter-controller
Dec 5, 2023
5112d9c
updated readme file
Eashika2504 Dec 6, 2023
3c00613
fixed errors in readme file
Eashika2504 Dec 11, 2023
1139b02
updated readme file
Eashika2504 Dec 11, 2023
b1197a9
added flutter dependecy in gitignore
Dec 11, 2023
181b6a2
updated gitignore
Dec 11, 2023
d42e985
removing .run
Dec 11, 2023
f828588
updated readme file
Eashika2504 Dec 11, 2023
2815682
added space b/w bullet points
Eashika2504 Dec 11, 2023
b3c8e37
changed indicators info alignment in readme
Eashika2504 Dec 11, 2023
736c2f9
fixed mute functionality on drive screen
Dec 12, 2023
0d6c562
changed UI for flutter controller settings
Dec 20, 2023
d5936f7
fixed drawer UI and added relevant settings
Dec 21, 2023
39c3295
added logs and network icon in on-screen control mode
Dec 28, 2023
2405ea9
fix state updation of fragment type
Dec 29, 2023
43b42c3
updated UI in tilting phone mode screen
Dec 30, 2023
08fd64a
integrate socket for fragment type
Eashika2504 Jan 1, 2024
5b88355
update change color switch button
Surajitinker Mar 21, 2024
0a65d7e
Merge branch 'master' of https://github.com/3dwesupport/OpenBot into …
isha382 Nov 22, 2024
b734c2b
updated kotlin version
isha382 Nov 25, 2024
236941c
updated readme and version
isha382 Nov 25, 2024
880aa6d
Updated README.md
isha382 Nov 25, 2024
e790567
fix minor changes
isha382 Nov 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
video view is set on all screen
  • Loading branch information
Sanjeev Sharma committed Jan 12, 2023
commit c26824088a7b8b0df0736d2ff736afe204986dcb
38 changes: 17 additions & 21 deletions controller/flutter/lib/screens/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ class ControllerState extends State<Controller> {
final registrations = <Registration>[];
ServerSocket? _serverSocket;
Stream<Uint8List>? _broadcast;
String sdp = "";
String type = "";
String id = "";
int label = 0;
String candidate = "";
bool videoView = false;

var _nextPort = 56360;
Expand All @@ -39,24 +34,22 @@ class ControllerState extends State<Controller> {

//webRTC________________

RTCVideoRenderer _remoteVideoRenderer = RTCVideoRenderer();
final RTCVideoRenderer _remoteVideoRenderer = RTCVideoRenderer();
RTCPeerConnection? _peerConnection;

// get remoteRenderer => _remoteVideoRenderer;

Future<void> videoConnection() async {
initRenderers();
_createPeerConnection().then((pc) {
_peerConnection = pc;
});
handleWebRtcEvent();
}

initRenderers() async {
await _remoteVideoRenderer.initialize();
}

void handleWebRtcEvent() async {
void handleWebRtcEvent(type, sdp, id, label, candidate) async {
var description = {
"type": type,
"sdp": sdp,
Expand Down Expand Up @@ -133,7 +126,6 @@ class ControllerState extends State<Controller> {
}

void createAnswer() async {
log("create answer call");
final Map<String, dynamic> offerSdpConstraints = {
"mandatory": {
"OfferToReceiveAudio": "false",
Expand All @@ -152,7 +144,6 @@ class ControllerState extends State<Controller> {
}

void sendMessage(message) async {
log("send message chala");
var newMessage = jsonEncode(message);
clientSocket?.writeln({"webrtc_event": newMessage});
}
Expand All @@ -167,6 +158,13 @@ class ControllerState extends State<Controller> {
void initState() {
super.initState();
registerNewService();
videoConnection();
}

@override
void dispose() async {
await _remoteVideoRenderer.dispose();
super.dispose();
}

Future<void> registerNewService() async {
Expand All @@ -188,13 +186,10 @@ class ControllerState extends State<Controller> {
} else {
clientSocket = socket;
_broadcast = clientSocket?.asBroadcastStream();
//
// clientSocket!.write("{driveCmd: {r:0.0, l:0.26}}");
// clientSocket!.write("{command: SWITCH_CAMERA}");

_broadcast?.map((data) => String.fromCharCodes(data)).listen(
(message) {
var msgInObject;
Map msgInObject;
try {
var jsonArr = message.split("\n");
for (var element in jsonArr) {
Expand All @@ -203,7 +198,6 @@ class ControllerState extends State<Controller> {
msgInObject = json.decode(json.decode(jsonMsg));
if (msgInObject["status"] != null) {
processMessageFromBot(msgInObject["status"]);
handleWebRtcEvent();
}
// log(msgInObject.toString() + "_____");
// setDeviceConnected();
Expand Down Expand Up @@ -280,15 +274,16 @@ class ControllerState extends State<Controller> {
}

void processMessageFromBot(items) {
log("items = $items");
String sdp = "";
String type = "";
String id = "";
int label = 0;
String candidate = "";
print("items = $items");
if (items["CONNECTION_ACTIVE"] != null) {
setDeviceConnected(items["CONNECTION_ACTIVE"]);
}

if (items["VIDEO_COMMAND"].toString() == "START") {
videoConnection();
}

if (items["WEB_RTC_EVENT"] != null) {
var webRTCResponse = json.decode(items["WEB_RTC_EVENT"]);
if (webRTCResponse["type"].toString() == "offer") {
Expand All @@ -305,6 +300,7 @@ class ControllerState extends State<Controller> {
candidate = webRTCResponse["candidate"].toString();
});
}
handleWebRtcEvent(type, sdp, id, label, candidate);
}
}
}
Expand Down
Loading