Skip to content

Commit 89dc286

Browse files
authored
Create option to show Video Feed in Teleop Modal (#148)
* Add video feed to teleop modal * Don't show video feed in teleop modal by default
1 parent 133ae56 commit 89dc286

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

feedingwebapp/src/Pages/Header/InfoModal.jsx

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,45 @@ function InfoModal(props) {
124124
{mode === VIDEO_MODE ? (
125125
<VideoFeed topic={CAMERA_FEED_TOPIC} updateRateHz={10} webrtcURL={props.webrtcURL} />
126126
) : mode === TELEOP_MODE ? (
127-
<TeleopSubcomponent allowIncreasingForceThreshold={true} allowRetaringFTSensor={true} />
127+
<View
128+
style={{
129+
flex: 1,
130+
flexDirection: 'column',
131+
justifyContent: 'center',
132+
alignItems: 'center',
133+
width: '100%',
134+
height: '100%'
135+
}}
136+
>
137+
{props.showVideoFeedDuringTeleop ? (
138+
<View
139+
style={{
140+
flex: 5,
141+
flexDirection: 'column',
142+
justifyContent: 'center',
143+
alignItems: 'center',
144+
width: '100%',
145+
height: '100%'
146+
}}
147+
>
148+
<VideoFeed topic={CAMERA_FEED_TOPIC} updateRateHz={10} webrtcURL={props.webrtcURL} />
149+
</View>
150+
) : (
151+
<></>
152+
)}
153+
<View
154+
style={{
155+
flex: 7,
156+
flexDirection: 'column',
157+
justifyContent: 'center',
158+
alignItems: 'center',
159+
width: '100%',
160+
height: '100%'
161+
}}
162+
>
163+
<TeleopSubcomponent allowIncreasingForceThreshold={true} allowRetaringFTSensor={true} />
164+
</View>
165+
</View>
128166
) : mode === SYSTEM_STATUS_MODE ? (
129167
<div>System Status</div>
130168
) : (
@@ -141,7 +179,12 @@ InfoModal.propTypes = {
141179
// Callback function for when the modal is hidden
142180
onHide: PropTypes.func.isRequired,
143181
// The URL of the webrtc signalling server
144-
webrtcURL: PropTypes.string.isRequired
182+
webrtcURL: PropTypes.string.isRequired,
183+
// Whether to show the video feed when teleoperating the robot
184+
showVideoFeedDuringTeleop: PropTypes.bool.isRequired
185+
}
186+
InfoModal.defaultProps = {
187+
showVideoFeedDuringTeleop: false
145188
}
146189

147190
export default InfoModal

0 commit comments

Comments
 (0)