Get Joint Angle of Robot's Wheels [getJointAngle()\
After some driving, you can use the getJointAngle block to find how many degrees each of the robot's wheel has turned:
Specify the Joint number you want to get the angle of and define a variable (such as "angle" as shown) to hold that value. For a regular Linkbot-I robot, with wheels on opposite sides, joint 1 is the left side and joint 3 is the right side as it faces forward.
Watch the video to learn more about the getJointAngle block.
Example 1: Get the Joint Angle of a Robot and Output to the User
Use the driveAngle block to drive the robot one full rotation of its wheels, then use getJointAngle to get the joint rotation for Joint 1, and print the result in the Console.
Piano
Grid Lines:
Tics Lines:
Widthpx
Hash Lines:
Widthpx
Labels:
Fontpx
Trace Lines:
Robot 1:
Widthpx
Robot 2:
Widthpx
Robot 3:
Widthpx
Robot 4:
Widthpx
Grid Size:
SML
Simple View:
MinView:
Coord: x-axisy-axis
Grid Lines: x-axisy-axis
Grid:
12x12 inches
24x24 inches
36x36 inches
72x72 inches
96x96 inches
192x192 inches
1x1 inches
2x2 inches
Fraction:
xy-Range:
Quad:
1 Quadrant
4 Quadrants
1&4 Quadrants
Units:
US Customary
Metric
Ruler:
Label:
1Linkbot
0
S
M
L
Initial Position (x, y):
(,) in
Initial Angle:
degrees
Current Position (x,y)
(0, 0) in
Current Angle:
90 degrees
Wheel Radius:
2Linkbot
0
S
M
L
Initial Position (x, y):
(,) in
Initial Angle:
degrees
Current Position (x,y)
(0, 6) in
Current Angle:
0 degrees
Wheel Radius:
3Linkbot
0
S
M
L
Initial Position (x, y):
(,) in
Initial Angle:
degrees
Current Position (x,y)
(0, 12) in
Current Angle:
0 degrees
Wheel Radius:
4Linkbot
0
S
M
L
Initial Position (x, y):
(,) in
Initial Angle:
degrees
Current Position (x,y)
(0, 18) in
Current Angle:
0 degrees
Wheel Radius:
Hardware
LArduino
Workspace
Load
Save
Ch
Ch Shell
Console
Lock
roboblocklyL400ex1.ch
Time
Pre-Board Workspace
Blocks
Workspace
Load
Save
Ch
Post-Board Workspace
Blocks
Workspace
Load
Save
Ch
varvar31101111221291.574503.12641051101100110010236812612MULTIPLY84MULTIPLY8.42Hi Sam\n Good day!variabletexttext\nvariable\n13comment2xyLeft click on gridxyLeft click on gridxyLeft click on grid30505correct3verticalvariableFALSEvariablevarvar2var13variable1FALSE3variablevar13var2var13variable1FALSE3variablevar13var2varFFFF00#999999#a52a2a2#00ffff0.700#ffffff0.7010#00ff000.5002#ffffff0.7004#00ff000.50.03x axistime (s)x-1010x5x1centertext4544891000490054544300804400890101002*x+11186231100286880121268000545315005453150054518000201200020120452700068-60-2626601,2,312380100012512612Dog568imageDogimageimage568image90imagehorizontalimage10.713OUTPUT13HIGH1330100013OUTPUT13HIGH1330A013100010003131000100031313100010001398985A09100019544240099091500999A0LOWOUTPUT0010230255590434904#00FFFF#00FFFF40.55555345090LadybugM10010HelloHello2HmmHmm2Hello100femaleen#00FFFF0.50.52colorshighlow21C3HalfC31200115904349034500.50.52colorshighlow21590434904#A52A2A#A52A2A40.55555345090LadybugM10010HelloHello2HmmHmm2Hello100femaleen#A52A2A0.50.52colorshighlow21C3HalfC31200115904349034500.50.52colorshighlow21590434904#FFA500#FFA50040.55555345090LadybugM10010HelloHello2HmmHmm2Hello100femaleen#FFA5000.50.52colorshighlow21C3HalfC31200115904349034500.50.52colorshighlow21590434904#000000#00000040.55555345090LadybugM10010HelloHello2HmmHmm2Hello100femaleen#0000000.50.52colorshighlow21C3HalfC31200115904349034500.50.52colorshighlow21varvar31101111221291.574503.12641051101100110010236812612MULTIPLY84MULTIPLY8.42Hi Sam\n Good day!variabletexttext\nvariable\n13comment2xyLeft click on gridxyLeft click on gridxyLeft click on grid30505correct3verticalvariableFALSEvariablevarvar2var13variable1FALSE3variablevar13var2var13variable1FALSE3variablevar13var2varFFFF00#999999#a52a2a2#00ffff0.700#ffffff0.7010#00ff000.5002#ffffff0.7004#00ff000.50.03x axistime (s)x-1010x5x1centertext4544891000490054544300804400890101002*x+11186231100286880121268000545315005453150054518000201200020120452700068-60-2626601,2,312380100012512612Dog568imageDogimageimage568image90imagehorizontalimage10.713OUTPUT13HIGH1330100013OUTPUT13HIGH1330A013100010003131000100031313100010001398985A09100019544240099091500999A0LOWOUTPUT001023025555111190904#00FFFF#00FFFF41C3Half#00FFFF113LadybugMHello100femaleen111135555111190904#A52A2A#A52A2A41C3Half#A52A2A113LadybugMHello100femaleen111135555111190904#FFA500#FFA50041C3Half#FFA500113LadybugMHello100femaleen111135555111190904#000000#00000041C3Half#000000113LadybugMHello100femaleen1111355varvar31101111221291.574503.12641051101100110010236812612MULTIPLY84MULTIPLY8.42Hi Sam\n Good day!variabletexttext\nvariable\n13comment2xyLeft click on gridxyLeft click on gridxyLeft click on grid30505correct3verticalvariableFALSEvariablevarvar2var13variable1FALSE3variablevar13var2var13variable1FALSE3variablevar13var2varFFFF00#999999#a52a2a2#00ffff0.700#ffffff0.7010#00ff000.5002#ffffff0.7004#00ff000.50.03x axistime (s)x-1010x5x1centertext4544891000490054544300804400890101002*x+1661812236600286880121268000545315005453150054518000201200020120452700068-60-2626601,2,312380100012512612Dog568imageDogimageimage568image90imagehorizontalimage10.713OUTPUT13HIGH1330100013OUTPUT13HIGH1330A013100010003131000100031313100010001398985A09100019544240099091500999A0LOWOUTPUT0010230255000909020909090909090909090909090000909020909090909090909090909090000909020909090909090909090909090000909020909090909090909090909090varvar31101111221291.574503.12641051101100110010236812612MULTIPLY84MULTIPLY8.42Hi Sam\n Good day!variabletexttext\nvariable\n13comment2xyLeft click on gridxyLeft click on gridxyLeft click on grid30505correct3verticalvariableFALSEvariablevarvar2var13variable1FALSE3variablevar13var2var13variable1FALSE3variablevar13var2varFFFF00#999999#a52a2a2#00ffff0.700#ffffff0.7010#00ff000.5002#ffffff0.7004#00ff000.50.03x axistime (s)x-1010x5x1centertext4544891000490054544300804400890101002*x+11186231100286880121268000545315005453150054518000201200020120452700068-60-2626601,2,312380100012512612Dog568imageDogimageimage568image90imagehorizontalimage10.713OUTPUT13HIGH1330100013OUTPUT13HIGH1330A013100010003131000100031313100010001398985A09100019544240099091500999A0LOWOUTPUT001023025513OUTPUT13HIGH1330100013OUTPUT13HIGH1330A013100010003131000100031313100010001398985A09100019544240099091500999A0LOWOUTPUT001023025513OUTPUT13HIGH1330100013OUTPUT13HIGH1330A013100010003131000100031313100010001398985A09100019544240099091500999A0LOWOUTPUT001023025513OUTPUT13HIGH1330100013OUTPUT13HIGH1330A013100010003131000100031313100010001398985A09100019544240099091500999A0LOWOUTPUT001023025513OUTPUT13HIGH1330100013OUTPUT13HIGH1330A013100010003131000100031313100010001398985A09100019544240099091500999A0LOWOUTPUT0010230255varvar31101111221291.574503.12641051101100110010236812612MULTIPLY84MULTIPLY8.42Hi Sam\n Good day!variabletexttext\nvariable\n13comment2FFFF00#999999#a52a2a2#00ffff0.700#ffffff0.7010#00ff000.5002#ffffff0.7004#00ff000.50.03x axistime (s)x-1010x5x1centertext4544891000490054544300804400890101002*x+11186231100286880121268000545315005453150054518000201200020120452700068-60-2626601,2,31238010001251212Dog568imageDogimageimage568image90imagehorizontalimage0.715LadybugM100#00FFFF90010LadybugM11x11x36x365x axistime (s)x-1010x5x1varvar31101111221291.574503.12641051101100110010236812612MULTIPLY84MULTIPLY8.42Hi Sam\n Good day!variabletexttext\nvariable\n13comment2xyLeft click on gridxyLeft click on gridxyLeft click on grid30505correct3verticalvariableFALSEvariablevarvar2var13variable1FALSE3variablevar13var2var13variable1FALSE3variablevar13var2varFFFF00#999999#a52a2a2#00ffff0.700#ffffff0.7010#00ff000.5002#ffffff0.7004#00ff000.50.03x axistime (s)x-1010x5x1centertext4544891000490054544300804400890101002*x+11186231100286880121268000545315005453150054518000201200020120452700068-60-2626601,2,312380100012512612Dog568imageDogimageimage568image90imagehorizontalimage0.715LadybugM100#00FFFF90010LadybugM11x11x36x365x axistime (s)x-1010360JOINT1angleangledegrees\n