def sample_configuration2(current_difficulty, info): perturbation = numpy.random.normal(0, 0.2, size=3) * current_difficulty goal_pos = info.get_observer(b"GoalObserver").get_position() b = [ neodroid.Configuration( "ManipulatorTriDOFConfigurableX", goal_pos[0] + perturbation[0] ), neodroid.Configuration( "ManipulatorTriDOFConfigurableY", goal_pos[1] + perturbation[1] ), neodroid.Configuration( "ManipulatorTriDOFConfigurableZ", goal_pos[2] + perturbation[2] ), ] return ( b + color_sample("Wall1") + color_sample("Wall2") + color_sample("Wall3") + color_sample("Wall4") + color_sample("Roof") + color_sample("Ground") )
def sample_configuration2(current_difficulty, info): perturbation = np.random.normal(0, 0.2, size=3) * current_difficulty goal_pos = info.get_observer(b'GoalObserver').get_position() b = [ neodroid.Configuration( 'ManipulatorTriDOFConfigurableX', goal_pos[0] + perturbation[0] ), neodroid.Configuration( 'ManipulatorTriDOFConfigurableY', goal_pos[1] + perturbation[1] ), neodroid.Configuration( 'ManipulatorTriDOFConfigurableZ', goal_pos[2] + perturbation[2] ), ] return b + color_sample('Wall1') + color_sample('Wall2') + color_sample( 'Wall3' ) + color_sample( 'Wall4' ) + color_sample( 'Roof' ) + color_sample( 'Ground' )
def color_sample(identifier): return [ neodroid.Configuration(identifier + 'ColorConfigurableR', np.random.sample()), neodroid.Configuration(identifier + 'ColorConfigurableG', np.random.sample()), neodroid.Configuration(identifier + 'ColorConfigurableB', np.random.sample()) # neodroid.Configuration(id+'ColorConfigurableA', # np.random.sample()), ]
def sample_configuration(current_difficulty, info): perturbation = numpy.random.normal(0, 0.2, size=3) * current_difficulty x, y, z = info.get_observer(b"GoalObserver").get_position() b = [ neodroid.Configuration("GoalTransformX", numpy.round(x + perturbation[0])), neodroid.Configuration("GoalTransformY", numpy.round(y + perturbation[1])), neodroid.Configuration("GoalTransformZ", numpy.round(z + perturbation[2])), ] return b
def color_sample(identifier): return [ neodroid.Configuration( identifier + "ColorConfigurableR", numpy.random.sample() ), neodroid.Configuration( identifier + "ColorConfigurableG", numpy.random.sample() ), neodroid.Configuration(identifier + "ColorConfigurableB", numpy.random.sample()) # neodroid.Configuration(id+'ColorConfigurableA', # numpy.random.sample()), ]