Commit f599324b authored by Pierre Fernbach's avatar Pierre Fernbach

loadRobotRomModel and loadRobotCompleteModel now take only a urdfName and srdfName as input

parent a6cf76a1
......@@ -32,21 +32,14 @@ module hpp
/// This function can be called several times to include several ROMs (one for each limb)
/// The device automatically has an anchor joint called "base_joint" as
/// root joint.
/// \param romRobotName the name of the robot range of motion.
/// Load robot model
/// \param robotName the name of the robot range of motion,
/// \param rootJointType type of root joint among "anchor", "freeflyer",
/// "planar",
/// \param packageName Name of the ROS package containing the model,
/// \param modelName Name of the package containing the model
/// \param urdfSuffix suffix for urdf file,
///
/// The ros url are built as follows:
/// "package://${packageName}/urdf/${modelName}${urdfSuffix}.urdf"
/// "package://${packageName}/srdf/${modelName}${srdfSuffix}.srdf"
/// \param urdfName name of the urdf file. It may contain
/// "file://", or "package://" prefixes.
///
void loadRobotRomModel (in string romRobotName, in string rootJointType,
in string packageName, in string modelName,
in string urdfSuffix, in string srdfSuffix)
void loadRobotRomModel (in string robotName, in string rootJointType,
in string urdfName)
raises (Error);
......@@ -54,20 +47,16 @@ module hpp
/// The device automatically has an anchor joint called "base_joint" as
/// root joint.
/// \param trunkRobotName the name of the robot trunk used for collision.
/// \param robotName the name of the robot trunk used for collision,
/// \param rootJointType type of root joint among "anchor", "freeflyer",
/// "planar",
/// \param packageName Name of the ROS package containing the model,
/// \param modelName Name of the package containing the model
/// \param urdfSuffix suffix for urdf file,
///
/// The ros url are built as follows:
/// "package://${packageName}/urdf/${modelName}${urdfSuffix}.urdf"
/// "package://${packageName}/srdf/${modelName}${srdfSuffix}.srdf"
/// \param urdfName name of the urdf file. It may contain
/// "file://", or "package://" prefixes.
/// \param srdfName name of the srdf file. It may contain
/// "file://", or "package://" prefixes.
///
void loadRobotCompleteModel (in string trunkRobotName, in string rootJointType,
in string packageName, in string modelName,
in string urdfSuffix, in string srdfSuffix)
void loadRobotCompleteModel (in string robotName, in string rootJointType,
in string urdfName, in string srdfName)
raises (Error);
/// Load fullbody robot model
......
......@@ -82,14 +82,16 @@ hpp::floatSeq vectorToFloatseq(const hpp::core::vector_t& input) {
return floats;
}
void RbprmBuilder::loadRobotRomModel(const char* robotName, const char* rootJointType, const char* packageName,
const char* modelName, const char* urdfSuffix,
const char* srdfSuffix) throw(hpp::Error) {
void RbprmBuilder::loadRobotRomModel(const char* robotName,
const char* rootJointType,
const char* urdfName) throw(hpp::Error) {
try {
hpp::pinocchio::DevicePtr_t romDevice = pinocchio::Device::create(robotName);
romDevices_.insert(std::make_pair(robotName, romDevice));
hpp::pinocchio::urdf::loadRobotModel(romDevice, std::string(rootJointType), std::string(packageName),
std::string(modelName), std::string(urdfSuffix), std::string(srdfSuffix));
hpp::pinocchio::urdf::loadModel(romDevice, 0, "",
std::string (rootJointType),
std::string (urdfName),
std::string ());
} catch (const std::exception& exc) {
hppDout(error, exc.what());
throw hpp::Error(exc.what());
......@@ -97,9 +99,10 @@ void RbprmBuilder::loadRobotRomModel(const char* robotName, const char* rootJoin
romLoaded_ = true;
}
void RbprmBuilder::loadRobotCompleteModel(const char* robotName, const char* rootJointType, const char* packageName,
const char* modelName, const char* urdfSuffix,
const char* srdfSuffix) throw(hpp::Error) {
void RbprmBuilder::loadRobotCompleteModel(const char* robotName,
const char* rootJointType,
const char* urdfName,
const char* srdfName) throw(hpp::Error) {
if (!romLoaded_) {
std::string err("Rom must be loaded before loading complete model");
hppDout(error, err);
......@@ -107,8 +110,10 @@ void RbprmBuilder::loadRobotCompleteModel(const char* robotName, const char* roo
}
try {
hpp::pinocchio::RbPrmDevicePtr_t device = hpp::pinocchio::RbPrmDevice::create(robotName, romDevices_);
hpp::pinocchio::urdf::loadRobotModel(device, std::string(rootJointType), std::string(packageName),
std::string(modelName), std::string(urdfSuffix), std::string(srdfSuffix));
hpp::pinocchio::urdf::loadModel(device, 0, "",
std::string (rootJointType),
std::string (urdfName),
std::string (srdfName));
// Add device to the planner
problemSolver()->robot(device);
problemSolver()->robot()->controlComputation(flag);
......
......@@ -157,13 +157,14 @@ class RbprmBuilder : public virtual POA_hpp::corbaserver::rbprm::RbprmBuilder {
void setServer(Server* server) { server_ = server; }
virtual void loadRobotRomModel(const char* robotName, const char* rootJointType, const char* packageName,
const char* modelName, const char* urdfSuffix,
const char* srdfSuffix) throw(hpp::Error);
virtual void loadRobotRomModel(const char* robotName,
const char* rootJointType,
const char* urdfName) throw(hpp::Error);
virtual void loadRobotCompleteModel(const char* robotName, const char* rootJointType, const char* packageName,
const char* modelName, const char* urdfSuffix,
const char* srdfSuffix) throw(hpp::Error);
virtual void loadRobotCompleteModel(const char* robotName,
const char* rootJointType,
const char* urdfName,
const char* srdfName) throw(hpp::Error);
virtual void loadFullBodyRobot(const char* robotName,
const char* rootJointType,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment