Asked

Python API

Hello,

We are currently utilizing Synthiam's ARC software to manage the movements of our robot's head. I would like to know if it is possible to write a Python script within ARC to control the blink rate of the robot's eyelids. We have servos installed that are responsible for moving the eyelids.

Thank you!


Related Hardware EZ-InMoov Robot Head
Related Control Script

ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

PRO
Canada
#1  

Hello! Yes, you can definitely use Python within Synthiam's ARC to control the blink rate of your EZ-InMoov Robot Head's eyelids. Since you have servos installed for the eyelids, you can write a Python script to control their movement.

Here's a basic example of how you might write a Python script to control the blink rate of the eyelids:

import time

# Define the servo ports for the eyelids
left_eyelid_servo_port = "D0"  # Replace with your actual port
right_eyelid_servo_port = "D1"  # Replace with your actual port

# Define the open and closed positions for the eyelids
eyelid_open_position = 90  # Adjust as needed
eyelid_closed_position = 0  # Adjust as needed

# Define the blink rate in seconds
blink_rate = 2  # Blink every 2 seconds

# Function to blink the eyelids
def blink_eyelids():
    while True:
        # Close the eyelids
        Servo.setPosition(left_eyelid_servo_port, eyelid_closed_position)
        Servo.setPosition(right_eyelid_servo_port, eyelid_closed_position)
        time.sleep(0.5)  # Keep closed for 0.5 seconds

        # Open the eyelids
        Servo.setPosition(left_eyelid_servo_port, eyelid_open_position)
        Servo.setPosition(right_eyelid_servo_port, eyelid_open_position)
        time.sleep(blink_rate)  # Wait for the blink rate duration

# Start blinking
blink_eyelids()

Steps to Implement:

  1. Open ARC: Launch your ARC project.
  2. Add a Script Control: If you haven't already, add a Script control to your project.
  3. Select Python: In the script editor, choose Python as the scripting language.
  4. Copy the Script: Copy the above script into the editor.
  5. Adjust Parameters: Make sure to adjust the servo ports and positions to match your setup.
  6. Run the Script: Execute the script to start controlling the blink rate.

Additional Tips:

  • You can adjust the blink_rate variable to change how often the eyelids blink.
  • Ensure that the servo ports and positions are correctly set for your specific setup.

If you have any further questions or need additional assistance, feel free to ask!


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#2  

Also, without knowing the InMoov head project, you may look at the Auto Position robot skill. If the project has one, the blink might be in that as an animation.