Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Base Reference in the BuildMechanism function

I would like to know if there is a way to set the Base Reference in the BuildMechanism() function? 
With the UI we can set the Base Reference we want, but I didn't find the way to set it with the API using BuildMechanism().



Best regards,


The parameter 'Base' is the base reference frame. The example right below the definition, explains it.


new_robot = RDK.BuildMechanism(MAKE_ROBOT_6DOF, list_objects, parameters, joints_build, joints_home, joints_senses, lower_limits, upper_limits, base_pose, tool_pose, robot_name)

Let me know if you have further questions.
Hello Vineet,

Thanks for your answer, I thought the parameter 'Base' was the 'Base shift' in the UI of Build Mechanism. But if it's actually the Base Reference, which one is the parameter of 'Base shift' in the BuildMechanism() function? 


Hello Yohan,

You are correct, its indeed the base shift. We will change our documentation to avoid confusion.
My guess is that the object frame of the base object is taken as the Base Reference. I will clarify this and get back to you.
It is not possible to specify the base frame of your 3D models using the API the same way you do with the UI. However, you can move the origin of your objects to your reference before calling BuildMechanism using the function setParentStatic.
Hi, I think the building of a mechanism in both the GUI and the API is still very confusing.

In my simple case I'm trying to build a two-finger gripper via the API, importing 3 STEP files (gripper body plus two fingers) using AddFile(), and then build the gripper using the BuildMechanism() command. How to set the "base" and "tool" poses would be straightforward if I clearly understood the definition of these poses, but the documentation I've found seems incomplete and confusing to me. Perhaps you could help me by clarifying a few things, starting with the GUI:

In the GUI build mechanism menu (see below), there are 3 poses/reference frames that can be set:
1) Base shift (HB), input as a XYZRotXYZ pose,
2) End-effector shift (HT), input as a XYZRotXYZ pose,
3) Base reference (FB), selected as a frame item.

What part of the gripper does each of these define, and with respect to what parent reference frame? And what will be the direction of movement of the gripper fingers, along which axis of which reference frame? In this youtube tutorial, Jeremy shows gripper fingers will move along some X-axis; the X-axis of which reference frame? And is this due to the set default pose of HB (0,0,0,0,90,0), or is this always the case due to some agreed definition?

The accompanying image in the menu shows reference frames FB and "FT". Where does FT come from? And with respect to what reference frame are FB and FT defined? And does the image apply only to the default pose of HB (0,0,0,0,90,0)? I think the image doesn't provide a clear and complete definition of the gripper mechanism.

Then three objects can be selected as "base" and two "joints" (fingers) of the gripper. To which reference frame of the gripper mechanism will each of these objects be attached? And does it take into account an object's pose with respect to its parent reference frame in the station tree? 

Then when it comes to the API: OK, so "base" in the BuildMechanism() command turns out to refer to the base shift (HB), as Vineet explains, not (?) to the Base reference (FB). To confuse things more, "base" and base shift (HB) correspond to fields referred to as "Base frame" in the kinematic properties (see image below) of the build robot...

Albert explains the Base reference (FB) can't be specified via the API; I don't know why. Without a clear understanding of what FD defines I do not know the implications when it can't be specified. It appears the pose of the mechanism in its reference frame always coincides with the pose of the gripper base object, am I right? Now what defines the direction of movement of the gripper fingers? Is it automatically the X-axis of the STEP file of the gripper base?

Lots of questions, but I've made so many different attempts and approaches to try and fully understand a mechanism's definition, all with unexpected behavior, that I'm lost.

Best regards,



Usually the picture shows the coordinate systems the way the default values would define them. For a gripper this means that the X axis is the axis of the movement. If you want to move around the Y axis, you would have to change your Base shift (HB).

The Base reference (FB) is the origin you want to use for your models. If you use the API, this would be equivalent of moving all objects relative to that coordinate system using the setParentStatic function (without altering the absolute position of the objects).

HB and HT are the base poses and tool poses respectively. These are mostly useful for industrial robots but they are kept in the UI and API. You can also later change them in the robot parameters menu (HB and HT become the Base pose and Tool pose of the robot parameters menu). You should be providing the full pose for this base and tool "shifts". When using the API, you can build this pose with any of our built in tools or customize it however you want. For example, for just a rotation around the Y axis you could type:
base_shift = roty(pi/2)
base_shift = xyzrpw_2_pose(0,0,0 , 0,90,0) # same thing
RDK.BuildMechanism(..., base=base_shift, tool=eye(4), ...)
Let me know if you are still having issues. If you can tell us what type of gripper you like from our library we can send you a screenshot of how it was built and we can then help you create it using a script.
Hi Albert, to my understanding, HB defines a relative 3D position plus orientation, referred to as a pose, that can be expressed e.g. in terms of XYZ position and some RXYZ rotation, or a 4x4 homogeneous transformation matrix. It can be visualized just like a frame of reference, at position XYZ, and with the XYZ-axes matching its orientation. Here it is used as a "shift" between two reference frames.

What I fail to grasp is 1) with respect to what parent pose or reference frame is HB applied in the mechanism definition, and 2) along which axis of HB will the gripper be moving (if its direction of movement is indeed related to HB at all)?

Users browsing this thread:
1 Guest(s)