krishauser

krishauser ·

Klampt Simulation Mode Error

It looks like the .rob model that you're using is not suitable for physics simulation since it has several zero-mass links. As a workaround, if you just want to get sensor data and don't care so much about the physics, you can use the sensor.kinematicSimul...

Installation

howto

First, please understand that Klampt is not an “app” but is rather a robot development library and toolkit. You will need to have a reasonable idea of what you’d like to use it for (run a simulation, control a robot, measure the quality of designs) in ...

Nonzero joint accelerations for fixed joints and virtual joints when using Klampt dynamics

  1. That function is not aware of any joint limits (or velocity limits), it just computes the raw forward dynamics in the full state space of the robot.

For fixed joints, you should actually solve a constrained dynamics equation. In other words...

Getting Segfault when loading a URDF

First of all, to run a program with GDB you need to first run it with the program name, then type "run [ARGS]".

Second, there's nothing wrong with the URDF model import, it's just that the RobotTest GUI assumes there will be at least one actuator in the r...

Getting Segfault when loading a URDF

Could you please post the URDF as code so this can actually be debugged?

Also, please run GDB on this so that the offending function can be identified.

selfCollision test

GetSelfCollisionPairs returns a matrix of which pairs of links have collisions enabled.

To get the pairs actually colliding, you want to call:
vector<pair<int,int> > pairs;
robot.SelfCollisions(pairs)

Trajectory optimization

Hi Jerry, trajectory optimization is on our TODO list! The main issue, which the SemiInfiniteOptimization package is trying to address, is the numeric encoding of geometric constraints. Other issues that need to be resolved are 1) which algorithms to inclu...

multi robot path planning

There is nothing “built-in” for this, but you could define a CSpace for kinematic multi-robot planning as long as you implement a joint configuration, sampler, and collision detector.

The kinodynamic planning pipeline is not implemented in Python, but y...

config Klampt for windows

It looks like you’re overriding your CMAKE_MODULE_PATH in the second SET call. Do SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ...) in your second call.

Simulate faster than real-time

howto

Yes, you can change the self.dt value in GLSimulationPlugin to some other simulation time step. By default it is 0.02s per refresh.

Make ee axis be along a certain direction in motion planning

If you are using the functions in robotPlanning (makeSpace, planToConfig, etc), the IK objective can be passed in the extraConstraints argument.

You can then plan as normal, except the resulting path will only be coarse milestones along the path. To get a...

Calculation of impact between object and robot?

Just to follow up: I discussed this issue in person, and the problem was apparently that the URDF file had links whose inertia matrices were on the order of 10^-8. This made simulation very numerically sensitive.

A second issue, which manifest...

Box creation and getting its location

The object has a reference frame, and if center is not zero, the geometry of the box will be created with that offset with respect of the reference frame. For most purposes, you want this to be zero.

However, you might for example want the object's refere...

Signed Distance Field with MeshToImplicitSurface_FMM

Try using EnviTriMeshTopology.CalcTriNeighbors() before calling MeshToImplicitSurface_FMM

Bug in klampt.model.create.primitives.box?

You’re right, this is completely wrong, I hastily adapted it from the unit cube rules. The fix has been pushed to master.

Calculation of impact between object and robot?

I'm pretty sure this a problem with the PID parameters not being tuned well. If you open this in SimTest, you can see the robot vibrating slightly after you move it or apply a force.

Calculation of impact between object and robot?

This type of thing happens usually when the PID controller is going unstable, or when the object is already penetrating through the robot upon simulator initialization.

Can you attach the code, robot file, and object file that generates this error?

You m...

report ValueError after setting movingSubset in robotplanning.makeSpace

I did look into this more carefully, and it does look like there will be problems keeping the constraint using the embedded + closed loop constraints because of various reasons (the configuration sampler in the ambient space allows the other joints to ...

report ValueError after setting movingSubset in robotplanning.makeSpace

Hi Yuan, as I described to you in person, I'm working on convenience functions to make this easy, but the workaround is as follows. gen_space.ambientspace is properly the ClosedLoopRobotCSpace that you had before. So you can do

path = gen_space.ambientspa...

Change the low-level reference using SetPIDCommand

Ah yes, I forgot that the C++ structure requires you to set up and interact with a subclass of the RobotController class.

By default, the simulator sets up the controller as a PolynomialPathController. The SetPIDCommand call is overridden by the control...

Change the low-level reference using SetPIDCommand

This looks correct, but do you know whether the motion is indeed possible for your chosen robot? If the movement is for example a leg pushing against the environment then you will see no movement unless the actuator is strong enough to push the robot over....

Checking if an object is stable under gravity in simulation

howto

The getCom function returns the local coordinates of the COM. You can do object.getWorldPosition(localcom).

To test stability, provided you know the contacts, you can use the functions here:

Delete a rigid object on-the-fly

howto

This is fairly safe to do... if you know what you’re doing. The simulation visualization might be messed up, somewhat, and the state saving and logging routines will definitely not work properly. But if you’re just simulating forward this should work just ...

Start configuration is infeasible

howto

Hi Yuan, we figured this out in person. Specifically the ik.fixed_rotation function uses the robots current configuration, which changes after you’ve solved for the goal configuration. Can you post the solution?