Skip to content
Snippets Groups Projects
Commit c5960f6f authored by vahrenkamp's avatar vahrenkamp
Browse files

Apply data search path for robot loading.

git-svn-id: http://svn.code.sf.net/p/simox/code/trunk@315 042f3d55-54a8-47e9-b7fb-15903f145c44
parent f106c707
No related branches found
No related tags found
No related merge requests found
......@@ -11,6 +11,7 @@
#include "../Visualization/VisualizationFactory.h"
#include "../Visualization/TriMeshModel.h"
#include "../RobotConfig.h"
#include "../RuntimeEnvironment.h"
#include "rapidxml.hpp"
#include <boost/pointer_cast.hpp>
#include <boost/filesystem.hpp>
......@@ -1021,12 +1022,19 @@ VirtualRobot::RobotPtr RobotIO::createRobotFromString( const std::string &xmlStr
VirtualRobot::RobotPtr RobotIO::loadRobot(const std::string &xmlFile, RobotDescription loadMode)
{
std::string fullFile = xmlFile;
if (!RuntimeEnvironment::getDataFileAbsolute(fullFile))
{
VR_ERROR <<"Could not open XML file:" << xmlFile << endl;
return RobotPtr();
}
// load file
std::ifstream in(xmlFile.c_str());
std::ifstream in(fullFile.c_str());
if (!in.is_open())
{
VR_ERROR <<"Could not open XML file:" << xmlFile << endl;
VR_ERROR <<"Could not open XML file:" << fullFile << endl;
return RobotPtr();
}
......@@ -1042,7 +1050,7 @@ VirtualRobot::RobotPtr RobotIO::loadRobot(const std::string &xmlFile, RobotDescr
VirtualRobot::RobotPtr res = createRobotFromString(robotXML, basePath, loadMode);
if (!res)
{
VR_ERROR << "Error while parsing file " << xmlFile << endl;
VR_ERROR << "Error while parsing file " << fullFile << endl;
}
res->applyJointValues();
......
......@@ -252,6 +252,57 @@
<Node name="Wrist 1 R"/>
<Node name="Wrist 2 R"/>
</RobotNodeSet>
<RobotNodeSet name="Robot" kinematicRoot="Platform">
<Node name="Neck_1_Pitch"/>
<Node name="Neck_2_Roll"/>
<Node name="Neck_3_Yaw"/>
<Node name="Head_Tilt"/>
<Node name="Cameras"/>
<Node name="Eye_Left"/>
<Node name="Eye_Right"/>
<Node name="Hip Pitch"/>
<Node name="Hip Roll"/>
<Node name="Hip Yaw"/>
<Node name="Shoulder 1 L"/>
<Node name="Shoulder 2 L"/>
<Node name="Upperarm L"/>
<Node name="Elbow L"/>
<Node name="Underarm L"/>
<Node name="Wrist 1 L"/>
<Node name="Wrist 2 L"/>
<Node name="Shoulder 1 R"/>
<Node name="Shoulder 2 R"/>
<Node name="Upperarm R"/>
<Node name="Elbow R"/>
<Node name="Underarm R"/>
<Node name="Wrist 1 R"/>
<Node name="Wrist 2 R"/>
<Node name="Hand Palm 1 L"/>
<Node name="Hand Palm 2 L"/>
<Node name="Thumb L J0"/>
<Node name="Thumb L J1"/>
<Node name="Index L J0"/>
<Node name="Index L J1"/>
<Node name="Middle L J0"/>
<Node name="Middle L J1"/>
<Node name="Ring L J0"/>
<Node name="Ring L J1"/>
<Node name="Pinky L J0"/>
<Node name="Pinky L J1"/>
<Node name="Hand Palm 1 R"/>
<Node name="Hand Palm 2 R"/>
<Node name="Thumb R J0"/>
<Node name="Thumb R J1"/>
<Node name="Index R J0"/>
<Node name="Index R J1"/>
<Node name="Middle R J0"/>
<Node name="Middle R J1"/>
<Node name="Ring R J0"/>
<Node name="Ring R J1"/>
<Node name="Pinky R J0"/>
<Node name="Pinky R J1"/>
</RobotNodeSet>
<RobotNodeSet name="PlatformYawTorsoLeftArm" kinematicRoot="Armar3_Base" tcp="TCP L">
<Node name="Yaw_Platform"/>
......@@ -282,4 +333,4 @@
</RobotNodeSet>
</Robot>
\ No newline at end of file
</Robot>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment