Skip to content

Commit

Permalink
Merge pull request moveit#261 from davetcoleman/jade-devel-velocity-e…
Browse files Browse the repository at this point in the history
…ffort-robot-state

Added setJointVelocity and setJointEffort functions
  • Loading branch information
isucan committed Nov 3, 2015
2 parents bf47bfe + dbec73f commit 3c4c7a6
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions robot_state/include/moveit/robot_state/robot_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,24 @@ class RobotState
updateMimicJoint(joint);
}

void setJointVelocities(const JointModel *joint, const double *velocity)
{
has_velocity_ = true;
memcpy(velocity_ + joint->getFirstVariableIndex(), velocity, joint->getVariableCount() * sizeof(double));
}

void setJointEfforts(const JointModel *joint, const double *effort)
{
if (has_acceleration_)
{
logError("Unable to set joint efforts because array is being used for accelerations");
return;
}
has_effort_ = true;

memcpy(effort_ + joint->getFirstVariableIndex(), effort, joint->getVariableCount() * sizeof(double));
}

const double* getJointPositions(const std::string &joint_name) const
{
return getJointPositions(robot_model_->getJointModel(joint_name));
Expand Down

0 comments on commit 3c4c7a6

Please sign in to comment.