Commit a3c28e58 authored by Florent Lamiraux's avatar Florent Lamiraux
Browse files

Check that joint exists when creating an operational point

  createOpPoint command with a valid name ("waist", "left-wrist",...) not
  set produced a segmentation faullt at signal recomputation due to access to
  a null pointer.
parent def06893
......@@ -1430,6 +1430,9 @@ void Dynamic::cmd_createOpPointSignals( const std::string& opPointName,
const std::string& jointName )
{
CjrlJoint* joint = getJointByName(jointName);
if (!joint) {
throw runtime_error ("Robot has no joint corresponding to " + jointName);
}
createEndeffJacobianSignal(std::string("J")+opPointName, joint);
createPositionSignal(opPointName, joint);
}
......@@ -1437,18 +1440,27 @@ void Dynamic::cmd_createJacobianWorldSignal( const std::string& signalName,
const std::string& jointName )
{
CjrlJoint* joint = getJointByName(jointName);
if (!joint) {
throw runtime_error ("Robot has no joint corresponding to " + jointName);
}
createJacobianSignal(signalName, joint);
}
void Dynamic::cmd_createJacobianEndEffectorSignal( const std::string& signalName,
const std::string& jointName )
{
CjrlJoint* joint = getJointByName(jointName);
if (!joint) {
throw runtime_error ("Robot has no joint corresponding to " + jointName);
}
createEndeffJacobianSignal(signalName, joint);
}
void Dynamic::cmd_createPositionSignal( const std::string& signalName,
const std::string& jointName )
{
CjrlJoint* joint = getJointByName(jointName);
if (!joint) {
throw runtime_error ("Robot has no joint corresponding to " + jointName);
}
createPositionSignal(signalName, joint);
}
......
Supports Markdown
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