diff --git a/feedingwebapp/src/Pages/Constants.js b/feedingwebapp/src/Pages/Constants.js index 6d3ee325..832687a4 100644 --- a/feedingwebapp/src/Pages/Constants.js +++ b/feedingwebapp/src/Pages/Constants.js @@ -123,7 +123,15 @@ export const SET_PARAMETERS_SERVICE_TYPE = 'rcl_interfaces/srv/SetParameters' // The names of parameters users can change in the settings menu export const DISTANCE_TO_MOUTH_PARAM = 'MoveToMouth.tree_kwargs.plan_distance_from_mouth' -export const ABOVE_PLATE_PARAM = 'MoveAbovePlate.tree_kwargs.joint_positions' +export const ABOVE_PLATE_PARAM_JOINTS = 'MoveAbovePlate.tree_kwargs.joint_positions' +export const STAGING_PARAM_JOINTS = 'MoveToStagingConfiguration.tree_kwargs.goal_configuration' +export const STAGING_PARAM_POSITION = 'MoveFromMouth.tree_kwargs.staging_configuration_position' +export const STAGING_PARAM_ORIENTATION = 'MoveFromMouth.tree_kwargs.staging_configuration_quat_xyzw' +// TODO: Eventually, we should break AcquireFood into two actionss to avoid these +// two different resting parameters. +export const RESTING_PARAM_JOINTS_1 = 'AcquireFood.tree_kwargs.resting_joint_positions' +// TODO: We may need to remove the orientation constraint from the below action. +export const RESTING_PARAM_JOINTS_2 = 'MoveToRestingPosition.tree_kwargs.goal_configuration' // Robot link names export const ROBOT_BASE_LINK = 'j2n6s200_link_base' diff --git a/feedingwebapp/src/Pages/Header/TeleopSubcomponent.jsx b/feedingwebapp/src/Pages/Header/TeleopSubcomponent.jsx index 8c538e5c..680ba50b 100644 --- a/feedingwebapp/src/Pages/Header/TeleopSubcomponent.jsx +++ b/feedingwebapp/src/Pages/Header/TeleopSubcomponent.jsx @@ -1,5 +1,6 @@ // React Imports import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react' +import Button from 'react-bootstrap/Button' import { useId, Label, SpinButton } from '@fluentui/react-components' import { useMediaQuery } from 'react-responsive' import PropTypes from 'prop-types' @@ -33,6 +34,7 @@ const TeleopSubcomponent = (props) => { const CARTESIAN_ANGULAR_MODE = 'Rotate' const JOINT_MODE = 'Joints' const [teleopMode, setTeleopMode] = useState(CARTESIAN_LINEAR_MODE) + const [refreshCount, setRefreshCount] = useState(0) const speedSpinButtonID = useId() // Cartesian teleop speeds @@ -137,7 +139,7 @@ const TeleopSubcomponent = (props) => { * unmounted. */ useEffect(() => { - console.log() + console.log('Starting servo', refreshCount) callROSAction(startServoAction, createROSMessage({})) let stopServoSuccessCallback = props.stopServoSuccessCallback return () => { @@ -149,7 +151,7 @@ const TeleopSubcomponent = (props) => { stopServoSuccessCallback.current() }) } - }, [startServoAction, stopServoAction, props.stopServoSuccessCallback]) + }, [refreshCount, startServoAction, stopServoAction, props.stopServoSuccessCallback]) /** * Callback function to publish constant cartesian cartesian velocity commands. @@ -557,6 +559,20 @@ const TeleopSubcomponent = (props) => { width: '100%' }} > +