Servo's



  • Is there a way to control Servo's through the API?



  • Yes, the servo can be controlled by modifying its properties using the API function SetProperty().

    For example, if you wish to manipulate the Arm1Servo that is defined in the treaded vehicle example, the property to set is "DesiredPos".

    # connect to ANVEL
    API = ConnectToANVEL('127.0.0.1', 9094)  # default loopback configuration for the server
    API.LoadEnvironment('LargeParkingLot.env')
    time.sleep(1)
    
    myVeh = API.CreateObject('Treaded Robot', 'myRobot', 0, Point3(1,1,1), Euler(0, 0, 0), True)
    
    myServo= API.GetObjectDescriptorByTypeAndName("Servo","Arm1Servo")
    API.SetProperty(myServo.id, "DesiredPos","0.2")  
    

    Thank you for your question.

    ANVEL Support Team


Log in to reply
 

Looks like your connection to ANVEL Forum was lost, please wait while we try to reconnect.