Skip to content

Commit

Permalink
Fixed cuff problem
Browse files Browse the repository at this point in the history
  • Loading branch information
jianqiaol committed Feb 10, 2016
1 parent 4268134 commit b84feb1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions common/Motion/motion_physical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ bool MyControllerUpdateData::MyStartup() {
assemblyState.subscribe(*nh,"robot/state",10);
jointState.subscribe(*nh,"robot/joint_states",10);
headState.subscribe(*nh,"robot/head/head_state",10);
leftCuffState.state = 0;
rightCuffState.state = 0;
leftCuffState->state = 0;
rightCuffState->state = 0;
leftCuffState.subscribe(*nh,"robot/digital_io/left_lower_cuff/state",10);
rightCuffState.subscribe(*nh,"robot/digital_io/right_lower_cuff/state",10);
leftGripperState.subscribe(*nh,"robot/end_effector/left_gripper/state",10);
Expand Down Expand Up @@ -447,15 +447,15 @@ bool MyControllerUpdateData::MyProcessSensors()
robotState.rightLimb.sensedEffort[k] = jointState->effort[i];
}
}
if(robotState.leftLimb.commandedConfig.empty() || leftCuffState.state==1 /*startup or cuff pressed, reset commanded*/) {
if(robotState.leftLimb.commandedConfig.empty() || leftCuffState->state==1 /*startup or cuff pressed, reset commanded*/) {
SetLimbGovernor(LEFT,LimbState::Normal);
robotState.leftLimb.controlMode = LimbState::POSITION;
robotState.leftLimb.sendCommand = false;
robotState.leftLimb.commandedConfig = robotState.leftLimb.sensedConfig;
robotState.leftLimb.commandedVelocity = robotState.leftLimb.sensedVelocity;
robotState.leftLimb.commandedEffort = robotState.leftLimb.sensedEffort;
}
if(robotState.rightLimb.commandedConfig.empty() || rightCuffState.state==1 /*startup or cuff pressed, reset commanded*/) {
if(robotState.rightLimb.commandedConfig.empty() || rightCuffState->state==1 /*startup or cuff pressed, reset commanded*/) {
SetLimbGovernor(RIGHT,LimbState::Normal);
robotState.rightLimb.controlMode = LimbState::POSITION;
robotState.rightLimb.sendCommand = false;
Expand Down Expand Up @@ -748,6 +748,7 @@ void MyControllerUpdateData::MySendCommands()

void MyControllerUpdateData::MyShutdown()
{
/*
ros::Publisher enabler = nh->advertise<std_msgs::Bool>("/robot/set_super_enable",10);
while(ros::ok()) {
if(!assemblyState->enabled) {
Expand All @@ -762,6 +763,7 @@ void MyControllerUpdateData::MyShutdown()
ros::spinOnce();
ThreadSleep(0.5);
}
*/

ros::shutdown();
}
Expand Down

0 comments on commit b84feb1

Please sign in to comment.