Simple Joint Movement with Python

Forum Forums Visual Components 4.0 Robot Programming Simple Joint Movement with Python

Be sure to read the Forum Rules and Guidelines before start using the Forum.

This topic contains 1 reply, has 1 voice, and was last updated by  MichaelW 1 year, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #2194


    I try to move a robot in joint position mode with the Python API.

    Code looks like this:

    from vcScript import *
    from vcHelpers.Robot import *

    def OnRun():
    robot = getRobot()


    However, I can’t find the class:

    Error: vcHelpers.Robot was unable to find controller in component ”
    NeueKomponente “.
    Traceback (most recent call last):
    File “NeueKomponente::PythonScript”, line 6, in OnRun
    AttributeError: ‘NoneType’ object has no attribute ‘driveJoints’



    Any idea? In worked well in the old 2014 version.



    You must be logged in to view attached files.


    I have a solution. If someone finds this thread later, use the vcHelpers.robots2 lib instead the first version. Further, there is a difference, if the script is started inside the robot component (getRobot() with empty braces) and outsite like below.





    from vcScript import *
    from vcHelpers.Robot2 import *

    def OnRun():

    robot = getRobot(app.findComponent(“GenericRobot”))
    robot.Controller.moveJoint(5, 100)
    #move all 6 joints with method
    robot.driveJoints(0, 0, 90, 0, 45, 10)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.