Vector battery check SDK Python script

Publicado el: 27 diciembre 2021
en el canal de: Matrix Intel
187
3

Vector battery check SDK Python script .

I will paste the script here

********************** Script Starts Here: *************************
import anki_vector

with anki_vector.Robot() as robot:

battery_state = robot.get_battery_state()
if battery_state:
robot.behavior.say_text("I will Check my current battery state, please stand by...")
robot.behavior.set_eye_color(hue=0.83, saturation=0.76)
robot.behavior.say_text("My main battery voltage is")
print("Robot battery voltage: {0}".format(battery_state.battery_volts))
robot.behavior.say_text("{0}".format(battery_state.battery_volts))


robot.behavior.say_text("Next, I will Check my current battery level, please stand by...")
robot.behavior.say_text("My main battery level is")
print("Robot battery Level: {0}".format(battery_state.battery_level))
robot.behavior.say_text("{0}".format(battery_state.battery_level))

robot.behavior.say_text("Next, I will Check if my battery is currently charging, please stand by...")
robot.behavior.say_text("is Main Battery Charging?")
print("Robot battery is charging: {0}".format(battery_state.is_charging))
robot.behavior.say_text("{0}".format(battery_state.is_charging))

robot.behavior.say_text("Next, I will Check if i am currently on the charger, please stand by...")
robot.behavior.say_text("is Vector parked on charger?")
print("Robot is on charger platform: {0}".format(battery_state.is_on_charger_platform))
robot.behavior.say_text("{0}".format(battery_state.is_on_charger_platform))

robot.behavior.say_text("Next, I will Check how long will the charging take, please stand by...")
robot.behavior.say_text("Suggested Charging time is")
print("Robot suggested charger time: {0}".format(battery_state.suggested_charger_sec))
robot.behavior.say_text("{0}".format(battery_state.suggested_charger_sec))
robot.audio.stream_wav_file("vector_alert.wav",100)

print("Drive Vector off of charger...")
robot.behavior.say_text("I will drive off my charger now...")
robot.behavior.drive_off_charger()

print("Playing Animation Trigger 1:")
robot.behavior.say_text("o it's good to move a little bit")
robot.anim.play_animation_trigger('GreetAfterLongTime')

robot.behavior.say_text("Battery Check is now Complete, thank you for standing by...")

print("Drive Vector onto charger...")
robot.behavior.say_text("I am returning to my charger...")
robot.behavior.drive_on_charger()

********************** Script Ends Here: *************************


En esta página del sitio puede ver el video en línea Vector battery check SDK Python script de Duración hora minuto segunda en buena calidad , que subió el usuario Matrix Intel 27 diciembre 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 187 veces y le gustó 3 a los espectadores. Disfruta viendo!