mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-11-16 19:52:17 -05:00
roverstate yay yay. future implements for non-roomba rovers...
Container image / image (push) Failing after 54s
Container image / image (push) Failing after 54s
This commit is contained in:
@@ -20,8 +20,8 @@ export default function BottomLeftPod({ roverId }) {
|
||||
const headlight = useControlSelector((control) => control.pipeline?.headlight);
|
||||
const laser = useControlSelector((control) => control.pipeline?.laser);
|
||||
const hornDevice = useControlSelector((control) => control.pipeline?.horn);
|
||||
const headlightOn = useControlSelector((control) => Boolean(control.pipeline?.headlightState?.headlightOn));
|
||||
const laserOn = useControlSelector((control) => Boolean(control.pipeline?.laserState?.laserOn));
|
||||
const headlightOn = useControlSelector((control) => Boolean(control.pipeline?.roverState?.headlightOn));
|
||||
const laserOn = useControlSelector((control) => Boolean(control.pipeline?.roverState?.laserOn));
|
||||
const hornActive = useControlSelector((control) => Boolean(control.state.horn?.active));
|
||||
const { setHeadlight, setLaser, startHorn, stopHorn } = useControlActions();
|
||||
const canControl = useCanControlRover(roverId);
|
||||
|
||||
@@ -27,9 +27,8 @@ function AuxColumnContent({ accessoriesAvailable, onShowAccessories }) {
|
||||
const camera = useControlSelector((control) => control.state.camera);
|
||||
const horn = useControlSelector((control) => control.state.horn);
|
||||
const headlight = useControlSelector((control) => control.pipeline?.headlight);
|
||||
const headlightState = useControlSelector((control) => control.pipeline?.headlightState);
|
||||
const roverState = useControlSelector((control) => control.pipeline?.roverState);
|
||||
const laser = useControlSelector((control) => control.pipeline?.laser);
|
||||
const laserState = useControlSelector((control) => control.pipeline?.laserState);
|
||||
const pipelineHorn = useControlSelector((control) => control.pipeline?.horn);
|
||||
const { setServoAngle, setHeadlight, setLaser, setAuxMotors, startHorn, stopHorn } = useControlActions();
|
||||
const dockTelemetry = useTelemetrySelector(roverId, selectDockTelemetry, dockTelemetryEqual);
|
||||
@@ -152,7 +151,7 @@ function AuxColumnContent({ accessoriesAvailable, onShowAccessories }) {
|
||||
<GPIOToggleControl
|
||||
label="Headlight"
|
||||
icon={FaLightbulb}
|
||||
on={headlightState?.headlightOn}
|
||||
on={roverState?.headlightOn}
|
||||
disabled={controlsDisabled}
|
||||
onToggle={handleHeadlightToggle}
|
||||
heightClass="h-full"
|
||||
@@ -162,7 +161,7 @@ function AuxColumnContent({ accessoriesAvailable, onShowAccessories }) {
|
||||
<GPIOToggleControl
|
||||
label="Laser"
|
||||
icon={FaCrosshairs}
|
||||
on={laserState?.laserOn}
|
||||
on={roverState?.laserOn}
|
||||
disabled={controlsDisabled || roomLightsLockedOn}
|
||||
onToggle={handleLaserToggle}
|
||||
heightClass="h-full"
|
||||
|
||||
@@ -48,8 +48,7 @@ export function useCommandPipeline(options = {}) {
|
||||
[rosterEntry],
|
||||
);
|
||||
|
||||
const headlightState = useMemo(() => rosterEntry?.headlight?.state ?? null, [rosterEntry]);
|
||||
const laserState = useMemo(() => rosterEntry?.laser?.state ?? null, [rosterEntry]);
|
||||
const roverState = rosterEntry?.roverState ?? null;
|
||||
const emitCommand = useCallback(
|
||||
(payload, cb) => {
|
||||
if (!roverId || !socket.connected) {
|
||||
@@ -234,9 +233,8 @@ export function useCommandPipeline(options = {}) {
|
||||
rosterEntry,
|
||||
servoConfig,
|
||||
headlight,
|
||||
headlightState,
|
||||
roverState,
|
||||
laser,
|
||||
laserState,
|
||||
horn,
|
||||
peripherals,
|
||||
emitCommand,
|
||||
@@ -256,9 +254,8 @@ export function useCommandPipeline(options = {}) {
|
||||
rosterEntry,
|
||||
servoConfig,
|
||||
headlight,
|
||||
headlightState,
|
||||
roverState,
|
||||
laser,
|
||||
laserState,
|
||||
horn,
|
||||
peripherals,
|
||||
emitCommand,
|
||||
|
||||
@@ -58,9 +58,8 @@ function DriveDockPanel() {
|
||||
const camera = useControlSelector((control) => control.state.camera);
|
||||
const horn = useControlSelector((control) => control.state.horn);
|
||||
const headlight = useControlSelector((control) => control.pipeline?.headlight);
|
||||
const headlightState = useControlSelector((control) => control.pipeline?.headlightState);
|
||||
const roverState = useControlSelector((control) => control.pipeline?.roverState);
|
||||
const laser = useControlSelector((control) => control.pipeline?.laser);
|
||||
const laserState = useControlSelector((control) => control.pipeline?.laserState);
|
||||
const pipelineHorn = useControlSelector((control) => control.pipeline?.horn);
|
||||
const { setServoAngle, setHeadlight, setLaser, startHorn, stopHorn } = useControlActions();
|
||||
const dockTelemetry = useTelemetrySelector(roverId, selectDockTelemetry, dockTelemetryEqual);
|
||||
@@ -126,7 +125,7 @@ function DriveDockPanel() {
|
||||
{headlightAvailable && (
|
||||
<GPIOToggleControl
|
||||
label="Headlight"
|
||||
on={headlightState?.headlightOn}
|
||||
on={roverState?.headlightOn}
|
||||
disabled={!roverId}
|
||||
onToggle={auxControls.setHeadlight}
|
||||
keyLabel={headlightLabel}
|
||||
@@ -135,7 +134,7 @@ function DriveDockPanel() {
|
||||
{laserAvailable && (
|
||||
<GPIOToggleControl
|
||||
label="Laser"
|
||||
on={laserState?.laserOn}
|
||||
on={roverState?.laserOn}
|
||||
disabled={!roverId || roomLightsLockedOn}
|
||||
onToggle={auxControls.setLaser}
|
||||
keyLabel={laserLabel}
|
||||
|
||||
Reference in New Issue
Block a user