leggedrobotics / raisimLib

RAISIM, A PHYSICS ENGINE FOR ROBOTICS AND AI RESEARCH
http://www.raisim.com
325 stars 50 forks source link

Crashing of Object function got by raisim::World::getObject only when rendering. #28

Closed mktk1117 closed 4 years ago

mktk1117 commented 4 years ago

When I have a world and added a height map as below,

std::unique_ptr<raisim::World> world;
heightMap = world->addHeightMap(0.0, 0.0, terrainProperties);
heightMap->setName("heightMap");

The getObject function with name and casting to the HeightMap class works fine without rendering.

const auto& heightMap = dynamic_cast<HeightMap*>(world->getObject("heightMap"));
double height = heightMap->getHeight(0.0, 0.0);

But, when I enable the rendering, it crashes with the same program.

Valgrind gives

Address 0x4a8 is not stack'd, malloc'd or (recently) free'd 0x53C8FE0: raisim::HeightMap::getHeight(double, double) const (in /opt/raisim/lib/libraisim.so)

jhwangbo commented 4 years ago

why const auto& heightMap not const auto heightMap?

jhwangbo commented 4 years ago

We found that this is an Ogre bug. We posted an issue here. Closing this issue for now