Skip to content

Create option to show Video Feed in Teleop Modal #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 21, 2024
Merged
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
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
Loading