diff --git a/source/ArmarXSimulation/components/Simulator/Simulator.cpp b/source/ArmarXSimulation/components/Simulator/Simulator.cpp index f12eaff9ba71805001d0914092710ef1456b5711..ea60820668dec3ce1544cd1dd2f1677f0cff630e 100644 --- a/source/ArmarXSimulation/components/Simulator/Simulator.cpp +++ b/source/ArmarXSimulation/components/Simulator/Simulator.cpp @@ -527,11 +527,10 @@ void Simulator::addSceneFromSdfFile(const std::string& scenePath) std::filesystem::path modelPath; std::tie(std::ignore, modelPath) = *it; - std::string xmlName = modelPath.filename().generic_string() + ".xml"; - std::filesystem::path xmlPath = modelPath / xmlName; + std::string robotName = modelPath.filename().generic_string() + ".urdf"; + std::filesystem::path robotPath = modelPath / robotName; - VirtualRobot::ManipulationObjectPtr simoxObject = - VirtualRobot::ObjectIO::loadManipulationObject(xmlPath.string()); + VirtualRobot::RobotPtr robot = VirtualRobot::RobotIO::loadRobot(robotPath); auto pose = model->Get<ignition::math::Pose3f>("pose"); @@ -548,7 +547,7 @@ void Simulator::addSceneFromSdfFile(const std::string& scenePath) orientation.z() = pose.Rot().Z(); orientation.w() = pose.Rot().W(); - simoxObject->setGlobalPose(simox::math::pose(position, orientation)); + robot->setGlobalPose(simox::math::pose(position, orientation)); auto isStatic = model->Get<bool>("static"); VirtualRobot::SceneObject::Physics::SimulationType simType = @@ -556,13 +555,11 @@ void Simulator::addSceneFromSdfFile(const std::string& scenePath) ? VirtualRobot::SceneObject::Physics::eKinematic : VirtualRobot::SceneObject::Physics::eDynamic; - simoxObject->setSimulationType(simType); - simoxObject->setFilename(xmlPath.string()); - simoxObject->setName(name); + robot->setSimulationType(simType); + robot->setFilename(robotPath.string()); + robot->setName(name); - physicsWorld->addObstacle(simoxObject, simType, - xmlPath.string(), name, - {},scenePackage); + physicsWorld->addRobot(robot, 10.0, 0.0, 0.0, robotPath.string(), isStatic); }; for (