File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,20 @@ void Awake()
36
36
{
37
37
imagePublisher . Topic = RobotOptions . GetValue ( robotName + "Camera Topic" ) ;
38
38
}
39
- if ( RobotOptions . GetValue ( robotName + "Publish Camera" ) . Equals ( "True" ) ) {
40
- imagePublisher . enabled = true ;
41
- robotCamera . enabled = true ;
42
- }
43
39
if ( RobotOptions . Exists ( robotName + "Show Camera View" ) && RobotOptions . GetValue ( robotName + "Show Camera View" ) . Equals ( "True" ) ) {
40
+ robotCamera . targetDisplay = 0 ;
41
+ robotCamera . enabled = true ;
44
42
mainCamera . enabled = false ;
43
+
44
+ // If we are publishing the camera, we need to duplicate it because the publishing script
45
+ // will override the camera output.
46
+ if ( RobotOptions . GetValue ( robotName + "Publish Camera" ) . Equals ( "True" ) ) {
47
+ GameObject robotCameraDupe = Instantiate ( robotCamera . gameObject , robotCamera . gameObject . transform . parent ) ;
48
+ }
49
+ }
50
+ if ( RobotOptions . GetValue ( robotName + "Publish Camera" ) . Equals ( "True" ) ) {
51
+ imagePublisher . enabled = true ;
45
52
robotCamera . enabled = true ;
46
- robotCamera . targetDisplay = 0 ;
47
53
}
48
54
laserScanPublisher . Topic = RobotOptions . GetValue ( robotName + "Laser Scan Topic" ) ;
49
55
iMUPublisher . Topic = RobotOptions . GetValue ( robotName + "IMU Topic" ) ;
You can’t perform that action at this time.
0 commit comments