returnCode,resolution,image
=
vrep.simxGetVisionSensorImage(clientID,vision_handle,
0
,opmode)
color
=
np.asarray(image)
color.shape
=
(resolution[
1
], resolution[
0
],
3
)
color
=
color.astype(np.
float
)
color[color <
0
]
+
=
255
color
=
np.fliplr(color)
color
=
color.astype(np.uint8)
rgb
=
color[
1
]
rgb2
=
rgb[
1
]
r
=
rgb2[
0
]
g
=
rgb2[
1
]
b
=
rgb2[
2
]
print
(rgb2)
rgb3
=
[
139
,
139
,
163
]
rgb4
=
[
0
,
0
,
147
]
if
167
>b>
161
and
142
>r>
136
and
142
>g>
136
:
vrep.simxSetJointTargetPosition(clientID,vertical_handle,
0.5
,opmode)
time.sleep(
0.5
)
vrep.simxSetJointTargetPosition(clientID,cam_handle,angle
*
90
,opmode)
time.sleep(
0.5
)
vrep.simxSetJointTargetPosition(clientID,vertical_handle,
0.1
,opmode)
time.sleep(
5
)
vrep.simxSetJointTargetPosition(clientID,cam_handle,angle
*
0
,opmode)