mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-03-24 03:37:51 -04:00
feat: Introduce dedicated participant, experiment, and trial detail/edit pages, enable MinIO, and refactor dashboard navigation.
This commit is contained in:
@@ -39,8 +39,11 @@ export interface UseWizardRosReturn {
|
||||
};
|
||||
},
|
||||
) => Promise<RobotActionExecution>;
|
||||
callService: (service: string, args?: Record<string, unknown>) => Promise<any>;
|
||||
setAutonomousLife: (enabled: boolean) => Promise<boolean>;
|
||||
}
|
||||
|
||||
|
||||
export function useWizardRos(
|
||||
options: UseWizardRosOptions = {},
|
||||
): UseWizardRosReturn {
|
||||
@@ -288,6 +291,24 @@ export function useWizardRos(
|
||||
[isConnected],
|
||||
);
|
||||
|
||||
const callService = useCallback(
|
||||
async (service: string, args?: Record<string, unknown>): Promise<any> => {
|
||||
const srv = serviceRef.current;
|
||||
if (!srv || !isConnected) throw new Error("Not connected");
|
||||
return srv.callService(service, args);
|
||||
},
|
||||
[isConnected],
|
||||
);
|
||||
|
||||
const setAutonomousLife = useCallback(
|
||||
async (enabled: boolean): Promise<boolean> => {
|
||||
const srv = serviceRef.current;
|
||||
if (!srv || !isConnected) throw new Error("Not connected");
|
||||
return srv.setAutonomousLife(enabled);
|
||||
},
|
||||
[isConnected],
|
||||
);
|
||||
|
||||
return {
|
||||
isConnected,
|
||||
isConnecting,
|
||||
@@ -297,5 +318,7 @@ export function useWizardRos(
|
||||
connect,
|
||||
disconnect,
|
||||
executeRobotAction,
|
||||
callService,
|
||||
setAutonomousLife,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user