mirror of
https://github.com/TimeCrafters/FTC_2022
synced 2025-12-15 21:22:33 +00:00
Added opmodes to start/stop TACNET service, sync.
This commit is contained in:
@@ -55,7 +55,7 @@ becomes obsolete.
|
|||||||
### Device Configuration Names
|
### Device Configuration Names
|
||||||
|
|
||||||
The following device names are used in the external samples
|
The following device names are used in the external samples
|
||||||
|
|
||||||
** Motors:
|
** Motors:
|
||||||
left_drive
|
left_drive
|
||||||
right_drive
|
right_drive
|
||||||
@@ -82,7 +82,7 @@ digout
|
|||||||
** Localization:
|
** Localization:
|
||||||
compass
|
compass
|
||||||
gyro
|
gyro
|
||||||
imu
|
imu
|
||||||
navx
|
navx
|
||||||
|
|
||||||
### Device Object Names
|
### Device Object Names
|
||||||
|
|||||||
@@ -183,6 +183,11 @@ public class FtcRobotControllerActivity extends Activity
|
|||||||
|
|
||||||
private WifiDirectChannelChanger wifiDirectChannelChanger;
|
private WifiDirectChannelChanger wifiDirectChannelChanger;
|
||||||
|
|
||||||
|
private static FtcRobotControllerActivity appActivity;
|
||||||
|
public static FtcRobotControllerActivity getAppActivity() {
|
||||||
|
return appActivity;
|
||||||
|
}
|
||||||
|
|
||||||
protected class RobotRestarter implements Restarter {
|
protected class RobotRestarter implements Restarter {
|
||||||
|
|
||||||
public void requestRestart() {
|
public void requestRestart() {
|
||||||
@@ -267,6 +272,7 @@ public class FtcRobotControllerActivity extends Activity
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
appActivity = this;
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
if (enforcePermissionValidator()) {
|
if (enforcePermissionValidator()) {
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -125,8 +125,8 @@ The readme.md file located in the [/TeamCode/src/main/java/org/firstinspires/ftc
|
|||||||
* Allows disabling bluetooth radio from inspection screen
|
* Allows disabling bluetooth radio from inspection screen
|
||||||
* Improves warning messages when I2C devices are not responding
|
* Improves warning messages when I2C devices are not responding
|
||||||
* Adds support for controlling the RGB LED present on PS4/Etpark gamepads from OpModes
|
* Adds support for controlling the RGB LED present on PS4/Etpark gamepads from OpModes
|
||||||
* Removes legacy Pushbot references from OpMode samples. Renames "Pushbot" samples to "Robot". Motor directions reversed to be compatible with "direct Drive" drive train.
|
* Removes legacy Pushbot references from OpMode samples. Renames "Pushbot" samples to "Robot". Motor directions reversed to be compatible with "direct Drive" drive train.
|
||||||
|
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
* Fixes [issue #316](https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/316) (MatrixF.inverted() returned an incorrectly-sized matrix for 1x1 and 2x2 matrixes).
|
* Fixes [issue #316](https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/316) (MatrixF.inverted() returned an incorrectly-sized matrix for 1x1 and 2x2 matrixes).
|
||||||
@@ -256,14 +256,14 @@ The readme.md file located in the [/TeamCode/src/main/java/org/firstinspires/ftc
|
|||||||
Cannot open OpModes in v6.1 Blocks offline editor
|
Cannot open OpModes in v6.1 Blocks offline editor
|
||||||
* Fixes [FtcRobotController issue #79](https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/79)
|
* Fixes [FtcRobotController issue #79](https://github.com/FIRST-Tech-Challenge/FtcRobotController/issues/79)
|
||||||
6.1 causes a soft reboot on the Motorola E5 Play
|
6.1 causes a soft reboot on the Motorola E5 Play
|
||||||
* Fixes issue where the Control Hub OS's watchdog would restart the Robot Controller app if
|
* Fixes issue where the Control Hub OS's watchdog would restart the Robot Controller app if
|
||||||
the Control Hub was not able to communicate with its internal Expansion Hub
|
the Control Hub was not able to communicate with its internal Expansion Hub
|
||||||
* Fixes certain I2C devices not showing up in the appropriate `HardwareMap` fields (such as `hardwareMap.colorSensor`)
|
* Fixes certain I2C devices not showing up in the appropriate `HardwareMap` fields (such as `hardwareMap.colorSensor`)
|
||||||
* Fixes issue where performing a Wi-Fi factory reset on the Control Hub would not set the Wi-Fi band to 2.4 GHz
|
* Fixes issue where performing a Wi-Fi factory reset on the Control Hub would not set the Wi-Fi band to 2.4 GHz
|
||||||
* Fixes issue where OnBotJava might fail to create a new file if the option to "Setup Code for Configured Hardware" was selected
|
* Fixes issue where OnBotJava might fail to create a new file if the option to "Setup Code for Configured Hardware" was selected
|
||||||
* Fixes issue where performing certain operations after an Op Mode crashes would temporarily break Control/Expansion Hub communication
|
* Fixes issue where performing certain operations after an Op Mode crashes would temporarily break Control/Expansion Hub communication
|
||||||
* Fixes issue where a Control Hub with a configured USB-connected Expansion Hub would not work if the Expansion Hub was missing at startup
|
* Fixes issue where a Control Hub with a configured USB-connected Expansion Hub would not work if the Expansion Hub was missing at startup
|
||||||
* Fixes potential issues caused by having mismatched Control/Expansion Hub firmware versions
|
* Fixes potential issues caused by having mismatched Control/Expansion Hub firmware versions
|
||||||
* Fixes [ftc_app issue 673](https://github.com/ftctechnh/ftc_app/issues/673) Latest matchlog is being deleted instead of old ones by RobotLog
|
* Fixes [ftc_app issue 673](https://github.com/ftctechnh/ftc_app/issues/673) Latest matchlog is being deleted instead of old ones by RobotLog
|
||||||
* Fixes ConceptVuforiaUltimateGoalNavigationWebcam sample opmode by correctly orienting camera on robot.
|
* Fixes ConceptVuforiaUltimateGoalNavigationWebcam sample opmode by correctly orienting camera on robot.
|
||||||
* Fixes issue where logcat would be spammed with InterruptedExceptions when stop is requested from the Driver Station (this behavior was accidentally introduced in v5.3). This change has no impact on functionality.
|
* Fixes issue where logcat would be spammed with InterruptedExceptions when stop is requested from the Driver Station (this behavior was accidentally introduced in v5.3). This change has no impact on functionality.
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.timecrafters.tacnet_management;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
|
||||||
|
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
|
||||||
|
|
||||||
|
import org.firstinspires.ftc.robotcontroller.internal.FtcRobotControllerActivity;
|
||||||
|
|
||||||
|
@TeleOp(name = "Halt TACNET Service", group = "TACNET")
|
||||||
|
public class HaltTACNETService extends OpMode {
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
Context appContext = FtcRobotControllerActivity.getAppActivity().getApplicationContext();
|
||||||
|
Intent tacnetIntent = new Intent("org.timecrafters.TimeCraftersConfigurationTool.tacnet.ACTION_START_SERVER");
|
||||||
|
tacnetIntent.setPackage("org.timecrafters.TimeCraftersConfigurationTool");
|
||||||
|
|
||||||
|
appContext.stopService(tacnetIntent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loop() {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package org.timecrafters.tacnet_management;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
|
||||||
|
import com.qualcomm.robotcore.eventloop.opmode.OpMode;
|
||||||
|
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
|
||||||
|
|
||||||
|
import org.firstinspires.ftc.robotcontroller.internal.FtcRobotControllerActivity;
|
||||||
|
|
||||||
|
@TeleOp(name = "Start TACNET Service", group = "TACNET")
|
||||||
|
public class StartTACNETService extends OpMode {
|
||||||
|
@Override
|
||||||
|
public void init() {
|
||||||
|
Context appContext = FtcRobotControllerActivity.getAppActivity().getApplicationContext();
|
||||||
|
Intent tacnetIntent = new Intent("org.timecrafters.TimeCraftersConfigurationTool.tacnet.ACTION_START_SERVER");
|
||||||
|
tacnetIntent.setPackage("org.timecrafters.TimeCraftersConfigurationTool");
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
appContext.startForegroundService(tacnetIntent);
|
||||||
|
} else {
|
||||||
|
appContext.startService(tacnetIntent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void loop() {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,3 +19,4 @@ dependencies {
|
|||||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
implementation 'org.firstinspires.ftc:gameAssets-PowerPlay:1.0.0'
|
implementation 'org.firstinspires.ftc:gameAssets-PowerPlay:1.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.2.2'
|
classpath 'com.android.tools.build:gradle:7.2.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user