Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
160 changes: 160 additions & 0 deletions openrpc.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,166 @@
"description": "Keys are relative file paths, values are YAML file contents as strings"
}
}
},
{
"name": "sim.emergency.set",
"summary": "Trigger or clear a latched emergency in the simulator.",
"paramStructure": "by-name",
"params": [
{
"name": "active",
"description": "true triggers a latched emergency, false clears it.",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"result": {
"name": "result",
"description": "No result is returned if successful.",
"schema": {
"type": "null"
}
}
},
{
"name": "sim.movement.set",
"summary": "Allow or block physical movement to simulate a stuck robot.",
"paramStructure": "by-name",
"params": [
{
"name": "allowed",
"description": "true = robot moves normally, false = robot is stuck.",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"result": {
"name": "result",
"description": "No result is returned if successful.",
"schema": {
"type": "null"
}
}
},
{
"name": "sim.battery.set",
"summary": "Set the simulated battery pack voltage.",
"paramStructure": "by-name",
"params": [
{
"name": "voltage",
"description": "Exact pack voltage to set (V).",
"required": true,
"schema": {
"type": "number"
}
}
],
"result": {
"name": "result",
"description": "No result is returned if successful.",
"schema": {
"type": "null"
}
}
},
{
"name": "sim.gps.set",
"summary": "Set the simulated GPS quality.",
"paramStructure": "by-name",
"params": [
{
"name": "good",
"description": "true = RTK fix (~2 cm), false = no RTK fix (~1 m).",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"result": {
"name": "result",
"description": "No result is returned if successful.",
"schema": {
"type": "null"
}
}
},
{
"name": "sim.joy_override.set",
"summary": "Enable or disable joystick (manual drive) override in the simulator.",
"paramStructure": "by-name",
"params": [
{
"name": "enabled",
"description": "true = joystick override active (manual drive), false = normal autonomous operation.",
"required": true,
"schema": {
"type": "boolean"
}
}
],
"result": {
"name": "result",
"description": "No result is returned if successful.",
"schema": {
"type": "null"
}
}
},
{
"name": "sim.dock.move",
"summary": "Drive the simulated robot onto the dock and start charging.",
"params": [],
"result": {
"name": "result",
"description": "No result is returned if successful.",
"schema": {
"type": "null"
}
}
},
{
"name": "sim.displace",
"summary": "Teleport the robot by (dx, dy) meters and dheading radians to simulate a GPS jump.",
"paramStructure": "by-name",
"params": [
{
"name": "dx",
"description": "X offset in meters (default 0).",
"required": false,
"schema": {
"type": "number"
}
},
{
"name": "dy",
"description": "Y offset in meters (default 0).",
"required": false,
"schema": {
"type": "number"
}
},
{
"name": "dheading",
"description": "Heading offset in radians (default 0).",
"required": false,
"schema": {
"type": "number"
}
}
],
"result": {
"name": "result",
"description": "No result is returned if successful.",
"schema": {
"type": "null"
}
}
}
]
}
8 changes: 6 additions & 2 deletions src/components/map/MowerMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import LayersButton from './LayersButton';
import MapDialog from './MapDialog';
import {mapStyles} from './mapStyles';
import MowerMarker from './MowerMarker';
import SimulatorButton from './SimulatorButton';
import TeleopControls from './teleop/TeleopControls';
import TrackLayer from './TrackLayer';

Expand Down Expand Up @@ -61,7 +62,9 @@ export function MowerMap({mapData, saveMapToMower, sx}: MowerMapProps) {
const currentState = useSelectedMower((s) => s?.state.current_state);
const isDocked = useSelectedMower((s) => s?.state.is_charging ?? false);
const mowerPosition = useSelectedMower((s) => s?.position ?? s?.state.pose);
const showTeleop = currentState === 'AREA_RECORDING' && !editMode;
const simAvailable = useSelectedMower((s) => s?.simState != null);
const manualDrive = useSelectedMower((s) => s?.simState?.joy_override ?? false);
const showTeleop = (currentState === 'AREA_RECORDING' || manualDrive) && !editMode;
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const areas = useMemo(
() => features.features.filter((feature) => feature.geometry.type === 'Polygon') as Feature<Polygon, AreaProps>[],
[features],
Expand Down Expand Up @@ -246,6 +249,7 @@ export function MowerMap({mapData, saveMapToMower, sx}: MowerMapProps) {
onClick={() => fitToBounds(false, padding)}
/>
<LayersButton datum={datum} trackLoading={trackLoading} editMode={editMode} />
{simAvailable && <SimulatorButton />}
<ControlButton
position="top-right"
icon={LayoutListIcon}
Expand Down Expand Up @@ -295,7 +299,7 @@ export function MowerMap({mapData, saveMapToMower, sx}: MowerMapProps) {
))}
{mowerPosition && !isDocked && <MowerMarker position={mowerPosition} datum={datumOrFallback} />}
<TrackLayer visible={showTrackLayer && !editMode} pastTrack={pastTrack} loading={trackLoading} />
{showTeleop && <TeleopControls />}
{showTeleop && <TeleopControls simulatorMode={manualDrive} />}
<DialogOutlet />
</RMap>
</Box>
Expand Down
Loading
Loading