def setNeckPitch(neckPitchDegrees): assert neckPitchDegrees <= 90 and neckPitchDegrees >= -90 m = lcmdrc.neck_pitch_t() m.utime = 0 m.pitch = math.radians(neckPitchDegrees) lcmUtils.publish('DESIRED_NECK_PITCH', m)
def setLidarRpm(rpm): m = lcmmultisense.command_t() m.utime = getUtime() m.fps = -1 m.gain = -1 m.agc = -1 m.rpm = rpm lcmUtils.publish('MULTISENSE_COMMAND', m)
def setLidarRevolutionTime(secondsPerRevolution): assert secondsPerRevolution >= 1.0 m = lcmmultisense.command_t() m.utime = getUtime() m.fps = -1 m.gain = -1 m.agc = -1 m.rpm = 60.0 / (secondsPerRevolution) lcmUtils.publish('MULTISENSE_COMMAND', m)
def sendMultisenseCommand(fps, gain, exposure, agc, rpm, led_flash, led_duty): m = lcmmultisense.command_t() m.utime = getUtime() m.fps = fps m.gain = gain m.exposure_us = exposure m.agc = agc m.rpm = rpm m.leds_flash = led_flash m.leds_duty_cycle = led_duty lcmUtils.publish('MULTISENSE_COMMAND', m)
def setNeckPitch(neckPitchDegrees): assert neckPitchDegrees <= 90 and neckPitchDegrees >= -90 jointGroups = drcargs.getDirectorConfig()['teleopJointGroups'] jointGroupNeck = filter(lambda group: group['name'] == 'Neck', jointGroups) if (len(jointGroupNeck) == 1): neckJoints = jointGroupNeck[0]['joints'] else: return # Assume first neck joint is the pitch joint m = lcmbotcore.joint_angles_t() m.utime = getUtime() m.num_joints = 1 m.joint_name = [neckJoints[0]] m.joint_position = [math.radians(neckPitchDegrees)] lcmUtils.publish('DESIRED_NECK_ANGLES', m)
def setNeckPitch(neckPitchDegrees): assert neckPitchDegrees <= 90 and neckPitchDegrees >= -90 jointGroups = drcargs.getDirectorConfig()['teleopJointGroups'] jointGroupNeck = filter(lambda group: group['name'] == 'Neck', jointGroups) neckJoints = jointGroupNeck[0]['joints'] if (len(neckJoints) == 1): # Atlas jointPositions = [math.radians(neckPitchDegrees)] elif (len(neckJoints) == 3): # Valkyrie, assuming joint 0 is lowerNeckPitch jointPositions = [math.radians(neckPitchDegrees), 0, 0] else: return # Assume first neck joint is the pitch joint m = lcmbotcore.joint_angles_t() m.utime = getUtime() m.num_joints = len(neckJoints) m.joint_name = neckJoints m.joint_position = jointPositions lcmUtils.publish('DESIRED_NECK_ANGLES', m)