Skip to content

Commit

Permalink
Cancel Autonomous Behaviors when Joints are Moved (#66)
Browse files Browse the repository at this point in the history
* stop any action being executed when joints are moved

* don't stop the trajectory client for incremental move to prevent jerky movements

* fixes from pre-commit

---------

Co-authored-by: hello-amal <[email protected]>
  • Loading branch information
hello-vinitha and hello-amal authored Jul 18, 2024
1 parent 18b18a4 commit df47962
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pages/robot/tsx/robot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -864,12 +864,14 @@ export class Robot extends React.Component {

executePoseGoal(pose: RobotPose) {
this.switchToPositionMode();
this.stopExecution();
this.poseGoal = this.makePoseGoal(pose);
this.trajectoryClient.createClient(this.poseGoal);
}

async executePoseGoals(poses: RobotPose[], index: number) {
this.switchToPositionMode();
this.stopExecution();
this.poseGoal = this.makePoseGoals(poses);
this.trajectoryClient.createClient(this.poseGoal);
}
Expand All @@ -885,6 +887,7 @@ export class Robot extends React.Component {

executeIncrementalMove(jointName: ValidJoints, increment: number) {
this.switchToPositionMode();
this.stopAutonomousClients();
this.poseGoal = this.makeIncrementalMoveGoal(jointName, increment);
this.trajectoryClient.createClient(this.poseGoal);
}
Expand All @@ -895,6 +898,11 @@ export class Robot extends React.Component {
this.stopMoveToPregraspClient();
}

stopAutonomousClients() {
this.stopMoveBaseClient();
this.stopMoveToPregraspClient();
}

stopTrajectoryClient() {
if (!this.trajectoryClient) throw "trajectoryClient is undefined";
if (this.poseGoal) {
Expand Down

0 comments on commit df47962

Please sign in to comment.