<s> import drc as lcmdrc <EOL> import bot_core as lcmbotcore <EOL> from director import lcmUtils <EOL> from director import affordanceurdf <EOL> class RaycastDriver ( object ) : <EOL> def __init__ ( self , request_channel = '<STR_LIT>' ) : <EOL> self . request_channel = request_channel <EOL> def requestRaycast ( self , affordances , lb = [ - <NUM_LIT:2> , - <NUM_LIT:2> ] , ub = [ <NUM_LIT:2> , <NUM_LIT:2> ] , step = <NUM_LIT> ) : <EOL> urdfStr = affordanceurdf . urdfStringFromAffordances ( affordances ) <EOL> msg = lcmdrc . terrain_raycast_request_t ( ) <EOL> msg . urdf = lcmbotcore . robot_urdf_t ( ) <EOL> msg . urdf . robot_name = "<STR_LIT>" <EOL> msg . urdf . urdf_xml_string = urdfStr <EOL> msg . x_min = lb [ <NUM_LIT:0> ] <EOL> msg . x_step = step <EOL> msg . x_max = ub [ <NUM_LIT:0> ] <EOL> msg . y_min = lb [ <NUM_LIT:1> ] <EOL> msg . y_step = step <EOL> msg . y_max = ub [ <NUM_LIT:1> ] <EOL> max_height = None <EOL> for aff in affordances : <EOL> bounds = aff . actor . GetBounds ( ) <EOL> zmax = bounds [ - <NUM_LIT:1> ] <EOL> max_height = max ( max_height , zmax ) <EOL> if max_height is not None : <EOL> msg . scanner_height = <NUM_LIT:10> + max_height <EOL> else : <EOL> msg . scanner_height = <NUM_LIT:10> <EOL> lcmUtils . publish ( self . request_channel , msg ) </s>
