krishauser

krishauser ·

Documentation on editing C-space

Yes, you can look at the addFeasibilityTest method: http://motion.cs.illinois.edu/software/klampt/latest/pyklampt_docs/klampt.plan.cspace.html#klampt.plan.cspace.CSpace.addFeasibilityTest

For complete overriding of constraints, you can see this exampl...

Velocity limitation of trajectory

howto

There are several methods in klampt.plan.motionplanning which admittedly are not particularly well documented due to some SWIG formatting issues. You can look at the C documentation in Klampt/Python/klampt/src/interpolate.h for some help.

If you would l...

is it possible to do planning for a point robot via Klampt?

Moved from github issue.

muk465 commented on Dec 5, 2021

Hi guys I want to plan a path for a point robot using rrt on a 3d image(3d numpy array) is it possible to do this using klampt? because when i was reading documentation i got the feeling that...

Set the position of the window in vis.visualization

bug howto

You can resize the window by setting the view width and height (attributes w and h in the object returned from vis.getViewport()). To set the position, you will need to use Qt or GLUT calls on the object accessed by vis.nativeWindow().window. See for examp...

Extra constraints in motion planner

howto support

IK is your best bet. If you want to keep the end effector position constant between the start and end, you can do it as follows

from klampt import ik
from klampt.math import vectorops

tool_center_point = [0,0,0]  #whatever you want here
local_axis = [1...

Motion planning: RuntimeError: Start Configuration is infeasible

bug

Ah, the planning_test.py has a bunch of flags at the top of the file to test more complex version of the motion planning functions, and these were set to 1 in the committed version. They should be set to 0. If you git pull, the most recent planning_tes...

Motion planning: RuntimeError: Start Configuration is infeasible

bug

That's strange. Can you try setting DO_SIMPLIFY=0 at the top and wrapping plan.setEndpoints(...) in a try/catch block as follows:

try:
    plan.setEndpoints(configs[i],configs[i+1])
 except RuntimeError:
    #one of the configurations must be infeasible
 ...

Motion planning: RuntimeError: Start Configuration is infeasible

bug

Typically this is caused by your URDF having some self collisions at the zero configuration. I suggest building the RobotTest app, then opening your URDF. If you check the “Self Collisions” box it will highlight self colliding links in red. You can also pr...

Klampt symbolic module capabilities

Yes, you can use the exprFromStr function in klampt.math.symbolic_io.

ctx = symbolic.Context()
ctx.addVar('x')
expr = symbolic_io.exprFromStr(ctx,'cos(x**2)')
print(expr.evalf({'x':3.0})  #prints -0.9111302618846769

There are no system solving functions,...

Is it possible to get TCP position if manipulator joint values are known? (Repost from Git Issues)

These would be the tool coordinates in the local frame of the end effector. (Default would be 0,0,0)

how to use klampt to control a simple robot arm (in python)

It has taken a long time for us to get here, but we finally have a good solution for this in Klampt 0.9. The now provides a uniform interface to controlling robots. If you write a small amount of driver code, you can run the Klampt-examples demos kbdr...

how to convert 3d volumetric grid into a world?

To use this as an obstacle geometry, you could create a VolumeGrid with a 1 where the obstacles exist, and a -1 where they do not. Then, you could call

grid_geometry = Geometry3D(grid)

then set up a collision detection subroutine that checks collision ...

how to do path planning in 3d numpy array?

You would need to subclass the CSpace class and implement the feasible(q), bound, and eps members. See the docs here for more information.

The feasible(q) callback is the essential function to determine whether a point q=[x,y,z] is in collision or not. In...

Is it possible to get TCP position if manipulator joint values are known? (Repost from Git Issues)

Yes, it just takes a few lines of code.

from klampt import *
from klampt.math import so3

#setup
world = WorldModel()
world.loadFile("myrobot.urdf")
robot = world.robot(0)

#query
endEffectorLink = robot.link(robot.numLinks()-1)
robot.setConfig(joints)
x,...

Is it possible to get TCP position if manipulator joint values are known? (Repost from Git Issues)

qwasko1212 asks:

I need to convert robot joint rotations to Cartesian coordinates of the TCP.

Example:
joints: [val, val, val, val, val, val] → Cartesian coordinates: [x, y, z, roll, pitch, yaw]

The idea of this task is to compare real robot position wit...

Solve inverse kinematics for end effector link with fixed orientation

Yes, please take a look at this function:

You could also pass a list of two points to ik.objective in the local and world arguments.

Segmentation Fault When Using Python 3

bug

This looks like a problem with whatever version of Assimp you have installed on your machine, but I've never seen the issue before. Could you report the version of your OS and your Assimp library?

The latest version of Klamp't (0.8.5) is built with the la...

Segmentation Fault When Using Python 3

bug

When segmentation faults occur, the best output you can provide to help diagnose the problem is to use gdb to get a stack trace.

  1. Install gdb (eg through apt-get)
  2. Run “gdb python“
  3. At the prompt, enter “run test.py”
  4. At the crash, enter “backtr...

Getting error when using the resounce module

Weird, this doesn't happen on my end, but there are some people who have the same problem with other X11 code. Can you

  1. give the sequence of items that pop up, and how you close them,
  2. post the full console output that causes the crash?

Does this ha...

negative Signed distance

The complexity and availability of signed distances depends very much on the geometry types. The most recent pythondocs.klampt.org documentation should provide up to date information on the availability.

As for point-cloud distances, these are indeed some...

Getting error when using the resounce module

Oops, more bugs I introduced. should be fixed now by git pulling master (or devel).

Avoid inverse kinematics and only simulate end-effector

howto

Yes, it is possible. If you create a robot model file (URDF or ROB) that just contains the gripper as a fixed object, you can use the utility klampt.model.create.moving_base_robot.make function to create a floating-base gripper model. Its first 6 DOF are...

negative Signed distance

There are some geometry types that support penetration depth estimation. Namely, primitive-primitive, volume grid-primitive, and volume grid-point cloud.

Penetration depth estimation between meshes is not (yet?) supported in Python. There are some approxi...

Klampt Simulation Mode Error

Ah, no there is no other way to do so at the moment.

Looking into your original error, the problem is the mass = 0 link (specifically, links 0 and 1). Try setting them to some small positive value in the .rob file.

capability for closed chains?

There is support for closed-chain kinematics, but it's not (yet?) in the dynamics API. This is not automatic, however, and getting closed-chain kinematics requires setting up one or more link-to-link inverse kinematics constraints and solving them as you...