Evaluate MinValue/MaxValue of a joint

Forum Forums Visual Components 4.0 Python Programming in VC Evaluate MinValue/MaxValue of a joint

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

This topic contains 4 replies, has 3 voices, and was last updated by Johnny Johnny 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #11450
    Johnny
    Johnny
    Participant

    Hi everyone

     

    I know that for properties on a component there’s the “CalculatedValue” property to get the actual value.

    Is there a way to do the same for the MinValue/MaxValue of a joint?

    I can only get the string from there.

    Thanks in advance for any help!

     

    Regards

    Johnny

    #11459

    JuergenB
    Participant

    Hi Johnny,

    I am also wondering, why the property returns a string.

    What’s wrong with casting the string to float?

     

    #11479
    Keke
    Keke
    Moderator

    Hi,

    Max and min limits are string expressions to allow dependencies to properties such as other joint values. And the properties in python API are MinLimit and MaxLimit and not MinValue and MaxValue. If the expression is simple numeric literal such as “360” you can cast it to float. With complex expression there is a way to solve those by creating a temporary expression property and solving the expression with it.

    Below there is an example which solves and prints link max limits for ABB IRB1200_5-90 robot, which has both simple and complex limit expressions:

    -k

    #11481
    Keke
    Keke
    Moderator

    To correct myself, the properties for vcDof are MinLimit and MaxLimit but for vcJoint they are MinValue and MaxValue.

    -k

    #11491
    Johnny
    Johnny
    Participant

    Hi

     

    @juergenb

    Thanks for your reply but since I reference a property in this expression I cannot simply cast it to float.

     

    @Keke

    Thanks for the fast help!

    This seems to be the best way currently, didn’t think about that solution.

    Maybe it would be a cool feature if you had some kind of method called “evalExpression” on the vcComponent instance to evaluate an expression.

    Anyways thanks for the solution I appreciate that! 🙂

     

    Regards

    Johnny

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

You must be logged in to reply to this topic.