robotology-legacy / mex-wholebodymodel

Matlab MEX interface to the iWholeBodyModel interface.
11 stars 9 forks source link

wbm_modelInitialise('icubGazeboSim') ignores the passed argument #32

Closed traversaro closed 8 years ago

traversaro commented 8 years ago

In the repo I found a lot of istances of wbm_modelInitialise('icubGazeboSim') , and I assume that it was a way to instantiate the mex-wholebodymodel with a robot with a given YARP_ROBOT_NAME. Unfortunatly I notice while installing the software for the TU/e master student that the script was not working at all if the YARP_ROBOT_NAME environmental variable was not set. I checked the code and apparently this happens because the argument of wbm_modelInitialise is passed as the robot parameter to the yarpWholeBodyModel constructor.

Unfortunately the robot parameter is the yarp prefix of ports used to access the robot controlboard/sensors, and it does not have nothing to do with the YARP_ROBOT_NAME enviromental variable!

I then guess that all people working with the simulation script (@Ganimed , @gabrielenava , @naveenoid ) has also the YARP_ROBOT_NAME environmental variable set, and for this reason that did not see this bug.

The fix is not easy, because there is not "local" way to set the YARP_ROBOT_NAME in the code. A possibility is to set the environmental variable from C++ or Matlab, but it is not a great idea to have code that change the environment. A proper solution involve adding a way for setting the YARP_ROBOT_NAME through the code, but without modify the environment.. I will open an issue in YARP to discuss this.

Another convenient feature to have (that is related to this) would be to directly specify the urdf file to load and the list of joints in matlab. The mex-wholebodymodel can then properly configure the yarpWholeBodyModel, disregarding at all the installed configuration files. I will open a separate issue for that.

naveenoid commented 8 years ago

I will go for the solution you proposed in the end since it maintains the standalone nature of mexwholebodymodel in the best way possible...


Naveen Kuppuswamy, PhD Post-doctoral Fellow, Cognitive Humanoids Lab, Department of Robotics, Brain and Cognitive Sciences (RBCS), Istituto Italiano di Tecnologia, Genova, Italy

On Tue, Sep 29, 2015 at 6:41 PM, Silvio Traversaro <notifications@github.com

wrote:

In the repo I found a lot of istances of wbm_modelInitialise('icubGazeboSim') , and I assume that it was a way to instantiate the mex-wholebodymodel with a robot with a given YARP_ROBOT_NAME. Unfortunatly I notice while installing the software for the TU/e master student that the script was not working at all if the YARP_ROBOT_NAME environmental variable was not set. I checked the code and apparently this happens because the argument of wbm_modelInitialise is passed as the robot parameter to the yarpWholeBodyModel constructor.

Unfortunately the robot parameter is the yarp prefix of ports used to access the robot controlboard/sensors, and it does not have nothing to do with the YARP_ROBOT_NAME enviromental variable!

I then guess that all people working with the simulation script (@Ganimed https://github.com/Ganimed , @gabrielenava https://github.com/gabrielenava , @naveenoid https://github.com/naveenoid ) has also the YARP_ROBOT_NAME environmental variable set, and for this reason that did not see this bug.

The fix is not easy, because there is not "local" way to set the YARP_ROBOT_NAME in the code. A possibility is to set the environmental variable from C++ or Matlab, but it is not a great idea to have code that change the environment. A proper solution involve adding a way for setting the YARP_ROBOT_NAME through the code, but without modify the environment.. I will open an issue in YARP to discuss this.

Another convenient feature to have (that is related to this) would be to directly specify the urdf file to load and the list of joints in matlab. The mex-wholebodymodel can then properly configure the yarpWholeBodyModel, disregarding at all the installed configuration files. I will open a separate issue for that.

— Reply to this email directly or view it on GitHub https://github.com/robotology/mex-wholebodymodel/issues/32.