-
Notifications
You must be signed in to change notification settings - Fork 7
Reference
0.5 setSpeed
0.01 setGridSize
0.6 -0.47 -0.017 0 1 0 0 moveToEEPose
/* x y z qx qy qz qw */
This useful command snaps the arm to the green strip in the clearance map and points in the direction traveled to get there:
pointToClearanceMap
This one turns the last joint by pi radians:
aboutFace
quarterTurn
There are two IK solvers in Ein. Service Mode uses Baxter's built-in IK solver. IK Fast mode uses a C++ library called IK Fast to implement its IK solver. To switch to Service Mode, use the following command:
ikModeService
To switch to Fast mode, use the following command:
ikModeIkFast
While in Fast mode, there are 3 different modes that allow the IK to choose paths that best suit your needs.
0 - local. No big joints flip, allows precision and smoothest curves. Prevents arm from making radical joint assumptions. 1 - global. Keeps arm maximally arched. Tries to create best arch for end effector. May cause jittery movement to compensate for optimal arch. 2 - switching. tries to keep smooth movement everywhere pointing straight down/small angles. But if there are extreme changes in joints, it won't necessarily be smooth but will attempt to prevent large flips in joint.
You may set the current Fast Mode by using the following command (this example sets the mode to 0).
0 setCurrentIKFastMode
In application, use service mode to get where you need to go, use global mode to make sure arm is in good initial position, and local mode for precise movement.
Initially, the control mode is set to End Effector Position mode. You can switch to Joint Angle Control Mode by issuing
setControlModeAngles
and switch back to End Effector Position mode with
setControlModeEePosition
You can print the current joint angles to the Ein stdout with
printJointAngles
Baxter robots have 7DOF arms. Ein references each joint by a number from 1 to 7. Joint 1 is the joint closest to the base, and joint 7 is the joint closest to the end effector.
Let's try controlling a joint. There are words in Ein that allow you to adjust the relative value of each joint. To increase the first joint, issue arm1Up
. This will increase the angle of that joint by the current grid size. Note that the current grid size is measured in cm for EE mode, and radians for joint controller mode.
Change the grid size with the command # setGridSize
Change the speed of movement with #setSpeed
All joints have words to increase and decrease relative joint angles. They are of the form arm#Up
and arm#Down
.
Sometimes you want to change an angle by an arbitrary amount, and not just one grid size unit. To increase a joint by 0.3 radians for instance, issue 0.3 arm#By
. To decrease the joint by 0.5, issue -0.5 arm#By
.
Now we can change any one joint by an arbitrary amount. But what if we want to change 2, or 3, or all at once? To do that, first we need to make a pose word.
We can use the command moveJointsByAngles
to achieve this. This command takes 7 arguments, which are the doubles you want each joint to move by. To move joints 1 and 2 by 0.1 and -0.2 respectively, issue
0.1 -0.2 0 0 0 0 0 moveJointsByAngles
Sometimes you know the absolute values of each joint angle you want. You can set the absolute values with the command moveJointsToAngles
. For example,
-0.5 -0.57933 -0.643056 1.37098 0.648439 0.1 -0.1 moveJointsToAngles
moves the joints to those exact angles.
To get Baxter's currently assumed joint angles, use the following command:
currentJointWord
To push an armPoseWord to the stack, use the following command with the 7 desired joint angles:
.2 0 .3 0 .1 -.1 -.2 createArmPose
To assign a word to the element on top of the stack, put the name of the storing variable in quotations and use the store command as follows:
"homePosition" store
To create a word for the current arm Pose, you can the following:
currentJointWord "baxterCurrentJointAngles" store
With a posed saved in a word, such as "homePosition", we can issue the following command:
homePosition moveJointsToAngles
NOTE: There are only quotes when initializing the variable. Afterwards, you do not use quotes.
BE CAREFUL
The stream images are subsampled with a probability which is expected to result in a fixed number of classification crops per class. That fixed number is specified by issuing:
400 setExpectedCropsToStream
but sampling is used, so the final number of crops will differ by some amount.
To keep the robot from trying to center the object at the beginning of a scan, issue:
setScanModeNotCentered
/* default is setScanModeCentered */
2 setGradientServoSoftMaxIterations
4 setGradientServoHardMaxIterations
5 setMappingServoTimeout
If work, reset the map blue boxes and the map time stamps by issuing
clearMapForPatrol clearBlueBoxMemories mappingPatrol
Object viewer blue boxes too large? Are there not enough blue boxes? Try adjusting the "Canny Thresholds":
30 35 setTrackbarLoHi
Blue boxes erasing eachother? Change their size.
fakeBBWidth
50 setFakeBBWidth
Empty space stomping the blue boxes? Adjust the buffer skirt within the gray box that doesn't get mapped.
mapGrayBoxPixelSkirtCols
110 setMapGrayBoxPixelSkirtCols
mapGrayBoxPixelSkirtRows
60 setMapGrayBoxPixelSkirtRows
Blue boxes dissolving?
mapFreeSpacePixelSkirt
25 setMapFreeSpacePixelSkirt
Advanced features for mapping
1 setMapAutoPick
5 setMapServoMode
Green dots in the map will be visited, and the arm will pursue objects into the yellow dots. The numbers are the distance from the red, so larger numbers mean less space.
searchProximity
23 setSearchProximity
pursuitProximity
5 setPursuitProximity
This useful command snaps you in
By default, when the robot picks an object, it may hand it to you. In order to have the robot stop and hold the object after picking, issue
setPlaceModeToHold
Other options are
setPlaceModeToHand setPlaceModeToHold setPlaceModeToRegister setPlaceModeToShake
You can adjust the force exerted by the parallel gripper to determine closure. The argument is a number between 0 and 100, see Rethink docs for more info.
50 setGripperMovingForce
You can annotate a 2D grasp by issuing:
10 10 2 0 annotate2dGrasp drawMapRegisters
Pick up a medicine bottle on its side from crane position. Go to a safe Z coordinate and issue
turnAboutY
To rotate ninety degrees about the end effector's Y axis.
Position the arm above a pedestal so that the bottle is positioned above the pedestal but the arm will miss the pedestal as Z decreases and the arm descends. Issue
pressAndRelease
and the arm will slowly lower, sense when the path is blocked, set the position to the blocked position, rise to release spring tension, return to the flush position, release, and back away.
Move to a safe distance and issue
unTurnAboutY
To save images and results of picks, issue:
enableDiskStreaming 1 setStreamPicks
Labels and images will be saved to the stream. To turn pick streaming off, issue:
disableDiskStreaming 0 setStreamPicks
Bandit learning happens during picks when the learning mode is set appropriately.
setPickModeToLearningAlgorithmC
You can choose how to do those picks, three ways being:
mapAndPickL
pickFocusedClass
focusedGraspLearning
Having just scanned some objects with scanObjectStreamWaypointsIR, issue
endArgs "ir_redLetter" "ir_blueBowl" setClassLabels assumeBeeHome 1 changeToHeight "ir_redLetter" setTargetClass setPickModeToLearningAlgorithmC
When the arm settles, position the object, in this case "ir_redLetter", under the end effector. Run
focusedGraspLearning
and the arm will pick that object in a loop, terminating when the algorithm indicates.
loadPriorGraspMemoryUniform setPickModeToStaticMarginals
changes the marginals to a uniform distribution over the top 10 grasps from the analytic prior and sets the pick mode to sample from this distribution, not modifying it in the process.
loadPriorGraspMemoryAnalytic setPickModeToLearningSampling
calculates the analytic prior and sets picks to perform Thompson sampling starting from from there.
Long button closes, circle button opens.
Pressing the back arrow clears the stacks. Pressing the Rethink button pushes an eePose word for the current position onto the stack. Pushing the selector wheel toggles Ein's zero G mode so you can freely move the arm. If zero G mode is enabled, Ein will not move the arm, so make sure to disable it when you are done with it.
Pressing the shoulder button will enable / disable the robot.
0 and 1 enable and disable, choose from left_itb_light_inner, right_itb_light_inner, torso_left_itb_light_inner, torso_right_itb_light_inner Outer Lights: left_itb_light_outer, right_itb_light_outer, torso_left_itb_light_outer, torso_right_itb_light_outer and issue:
1 "left_itb_light_inner" digitalIOCommand
0 "left_itb_light_inner" digitalIOCommand
Issue
50.0 setRedHalo
50.0 setGreenHalo
with a value between 0.0 and 100.0 to control the red and green channels.
Use the instructions from the Rethink API page to determine the UInt16 to send, and issue
4095 setSonarLed
0 setSonarLed
Setting to 0 reverts to automatic control. Or issue
0 8 switchSonarLed
1 8 switchSonarLed
to turn the eighth led (numbered 0 through 11) on or off. To force all lights off, issue
0 0 switchSonarLed 0 setSonarLed
If all systems are up, the message won't be published fast enough to make the lights stay on. But if you issue
shutdownToSensorsAndMovement
the main loop will turn over fast enough. Issue
bringUpAllNonessentialSystems
to undo.