コード例 #1
0
 def shuffle_obstacles(self):
     
     vrep.unwrap_vrep(
         vrep.simxCallScriptFunction(self._clientID, "Robobo_Scene_random", vrep.sim_scripttype_mainscript, "shuffle_obstacles",
                                     [],[],[],bytearray(),vrep.simx_opmode_blocking)
     )
     return
コード例 #2
0
 def _vrep_set_joint_target_position(self,
                                     handle,
                                     position,
                                     opmode=vrep.simx_opmode_oneshot):
     return vrep.unwrap_vrep(
         vrep.simxSetJointTargetPosition(self._clientID, handle, position,
                                         opmode))
コード例 #3
0
 def _vrep_get_vision_sensor_image(self,
                                   camera_handle,
                                   opmode=vrep.simx_opmode_buffer,
                                   a=0):
     return vrep.unwrap_vrep(
         vrep.simxGetVisionSensorImage(self._clientID, camera_handle, a,
                                       opmode))
コード例 #4
0
 def collected_food(self):
     ints, floats, strings, buffer = vrep.unwrap_vrep(
         vrep.simxCallScriptFunction(self._clientID, "Food",
                                     vrep.sim_scripttype_childscript,
                                     "remote_get_collected_food", [], [],
                                     [], bytearray(),
                                     vrep.simx_opmode_blocking))
     return ints[0]
コード例 #5
0
 def disconnect(self):
     vrep.unwrap_vrep(vrep.simxFinish(self._clientID))
コード例 #6
0
 def position(self):
     return vrep.unwrap_vrep(
         vrep.simxGetObjectPosition(self._clientID, self._Robobo, -1,
                                    vrep.simx_opmode_blocking))
コード例 #7
0
 def check_simulation_state(self):
     self.wait_for_ping()
     return vrep.unwrap_vrep(vrep.simxGetInMessageInfo(
         self._clientID, vrep.simx_headeroffset_server_state),
                             ignore_novalue_error=True)
コード例 #8
0
 def stop_world(self):
     vrep.unwrap_vrep(
         vrep.simxStopSimulation(self._clientID, vrep.simx_opmode_blocking))
     self.wait_for_ping()
コード例 #9
0
 def play_simulation(self):
     vrep.unwrap_vrep(
         vrep.simxStartSimulation(self._clientID,
                                  vrep.simx_opmode_blocking))
     self.wait_for_ping()
コード例 #10
0
 def pause_simulation(self):
     vrep.unwrap_vrep(
         vrep.simxPauseSimulation(self._clientID,
                                  vrep.simx_opmode_blocking))
コード例 #11
0
 def _vrep_set_joint_target_velocity(self, handle, speed, opmode):
     return vrep.unwrap_vrep(
         vrep.simxSetJointTargetVelocity(self._clientID, handle, speed,
                                         opmode))
コード例 #12
0
 def _vrep_read_proximity_sensor(self,
                                 handle,
                                 opmode=vrep.simx_opmode_streaming):
     return vrep.unwrap_vrep(
         vrep.simxReadProximitySensor(self._clientID, handle, opmode))
コード例 #13
0
 def _vrep_get_object_handle(self, name, opmode):
     return vrep.unwrap_vrep(
         vrep.simxGetObjectHandle(self._clientID, name, opmode))
コード例 #14
0
 def _vrep_get_ping_time(self):
     return vrep.unwrap_vrep(vrep.simxGetPingTime(self._clientID))
コード例 #15
0
 def stop_world(self):
     vrep.unwrap_vrep(
         vrep.simxStopSimulation(self._clientID, vrep.simx_opmode_blocking)
     )
     time.sleep(2)
コード例 #16
0
 def play_simulation(self):
     vrep.unwrap_vrep(
         vrep.simxStartSimulation(self._clientID, vrep.simx_opmode_blocking)
     )
     time.sleep(1)