Skip to content

Commit

Permalink
Create option to show Video Feed in Teleop Modal (#148)
Browse files Browse the repository at this point in the history
* Add video feed to teleop modal

* Don't show video feed in teleop modal by default
  • Loading branch information
amalnanavati authored Oct 21, 2024
1 parent 133ae56 commit 89dc286
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions feedingwebapp/src/Pages/Header/InfoModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,45 @@ function InfoModal(props) {
{mode === VIDEO_MODE ? (
<VideoFeed topic={CAMERA_FEED_TOPIC} updateRateHz={10} webrtcURL={props.webrtcURL} />
) : mode === TELEOP_MODE ? (
<TeleopSubcomponent allowIncreasingForceThreshold={true} allowRetaringFTSensor={true} />
<View
style={{
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%'
}}
>
{props.showVideoFeedDuringTeleop ? (
<View
style={{
flex: 5,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%'
}}
>
<VideoFeed topic={CAMERA_FEED_TOPIC} updateRateHz={10} webrtcURL={props.webrtcURL} />
</View>
) : (
<></>
)}
<View
style={{
flex: 7,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
width: '100%',
height: '100%'
}}
>
<TeleopSubcomponent allowIncreasingForceThreshold={true} allowRetaringFTSensor={true} />
</View>
</View>
) : mode === SYSTEM_STATUS_MODE ? (
<div>System Status</div>
) : (
Expand All @@ -141,7 +179,12 @@ InfoModal.propTypes = {
// Callback function for when the modal is hidden
onHide: PropTypes.func.isRequired,
// The URL of the webrtc signalling server
webrtcURL: PropTypes.string.isRequired
webrtcURL: PropTypes.string.isRequired,
// Whether to show the video feed when teleoperating the robot
showVideoFeedDuringTeleop: PropTypes.bool.isRequired
}
InfoModal.defaultProps = {
showVideoFeedDuringTeleop: false
}

export default InfoModal

0 comments on commit 89dc286

Please sign in to comment.