raisimTech / raisimLib

Visit www.raisim.com
http://www.raisim.com
Other
338 stars 91 forks source link

The result of rayTest to a heightmap at (0, 0) is always 0.035 #518

Open JewelryForge opened 10 months ago

JewelryForge commented 10 months ago

Hi Professor, I accidentally found that the rayTest to a heightmap at (0, 0) is always 0.035 even if the heightmap is different. For example, add the following code to line 60 in examples/heightmap.cpp. https://github.com/raisimTech/raisimLib/blob/9f1be941f0eeaeda57fa305c477039ca812d8d6a/examples/src/server/heightmap.cpp#L58

  Eigen::Vector3d start{0., 0., 100.};
  auto rays = world.rayTest(start, {0., 0., -1.}, 200, false);
  double ray_height = 0.;
  if (rays.size() > 0) {
    ray_height = rays[rays.size() - 1].getPosition()[2];
  }
  std::cout << hm->getHeight(start[0], start[1]) << " " << ray_height << std::endl;

It will output

0.441001 0.035

Interestingly, changing the seed of terrainProperties does not affect this result.