Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Klampt Simulation Mode Error #25

Hi Professor Hauser,

I'm trying to add sensors to a Klampt environment, but am running into some issues. From here, it looks like to simulate the sensors klampt.Simulator must be used. However, when doing that, I am running into the following issue:

ODESimulator: Initializing ODE...
Initializing simulation...
WorldSimulator: Creating WorldSimulation
ODESimulator: ODERobot: warning, body 0 has mass zero
ODESimulator:   Consists of links: trina_base_x_link,
ODESimulator: ODERobot: warning, body 0 has zero inertia
ODESimulator:   Consists of links: trina_base_x_link,
ODESimulator: ODERobot: warning, body 1 has mass zero
ODESimulator:   Consists of links: trina_base_y_link,
ODESimulator: ODERobot: warning, body 1 has zero inertia
ODESimulator:   Consists of links: trina_base_y_link,
ODESimulator: ODERobot: warning, body 3 has zero inertia
ODESimulator:   Consists of links: torso_link,
ODESimulator: ODERobot: warning, body 5 has zero inertia
ODESimulator:   Consists of links: left_ee_link,
ODESimulator: ODERobot: warning, body 6 has zero inertia
ODESimulator:   Consists of links: right_ee_link,
ODESimulator: ODERobot: warning, body 17 has zero inertia
ODESimulator:   Consists of links: left:gripper:base,
ODESimulator: ODERobot: warning, body 42 has zero inertia
ODESimulator:   Consists of links: right:gripper:base,

ODE Message 2: mass must be > 0 in dMassCheck() [mass.cpp:49]
ODESimulator: Uh... mass of body 0 is not considered to be valid by ODE?
ODESimulator:   Inertia: 0 0 0
0 0 0
0 0 0
ODESimulator:   Setting inertia to 0.01*identity.
Press enter to continue...
ODE Message 2: mass must be > 0 in dMassCheck() [mass.cpp:49]
ODE INTERNAL ERROR 1: assertion "dMassCheck(mass)" failed in dBodySetMass() [ode.cpp:485]
[1]    18616 abort (core dumped)  python sensing_test.py

Here is the .rob file that was used in the world. The above error occurs when I write sim = klampt.Simulator(world).

Looking at the warnings from the Simulator, the links that are receiving warnings correspond to the links that don't have a geometry file specified here and also here (the second file is included in the first file).

I was wondering if there is a way to fix this issue?

Thanks,
Eric

  • solved #4
  • replies 4
  • views 3.6K
  • likes 0
#2

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.kinematicSimulate(world) function.

#3

Is there a way to create a sensor without klampt.Simulator(world)? The example uses sim.controller(0) to create the sensor (sensor = sim.controller(0).sensor("rgbd_camera") and sensor = klampt.SimRobotSensor(sim.controller(0),'rgbd_camera','CameraSensor')).

#4

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.

ezhang887 accepted post #4 as the answer
#5