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: *************************
In questa pagina del sito puoi guardare il video online Vector battery check SDK Python script della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Matrix Intel 27 dicembre 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 187 volte e gli è piaciuto 3 spettatori. Buona visione!