JamesNewton / AdvancedRoboticsWithJavascript

A course in Robotics programming using Javascript in the Dexter Development Environment
The Unlicense
7 stars 8 forks source link

dde code #15

Open scienceisalie opened 5 years ago

scienceisalie commented 5 years ago

/ Job Example 2 move_all_joints takes 5 angles in degrees, one for each of Dexter's joints. move_to takes an xyz position (in meters from Dexter's base), where you want the end effect to end up. Beware, the 2nd and 3rd args to move_to determine the ending J5_direction and which way the joints go. These are tricky to get right. / / Job Example 2 move_all_joints takes 5 angles in degrees, one for each of Dexter's joints. move_to takes an xyz position (in meters from Dexter's base), where you want the end effect to end up. Beware, the 2nd and 3rd args to move_to determine the ending J5_direction and which way the joints go. These are tricky to get right. / new Job({name: "j2",

    do_list: [Dexter.move_all_joints([90, 90, -45, 0, 0]),
             Dexter.move_all_joints([180, 90, -45, 0, 0]),
             Dexter.move_all_joints([270, 90, -45, 0, 0]),
             Dexter.move_all_joints([0, 90, -45, 0, 0])//angles
                      //J5_direction

             ]})

//After defining this Job by clicking the EVAL button, //click this job's button in the Output pane's header to start it.

//After defining this Job by clicking the EVAL button, //click this job's button in the Output pane's header to start it.

cfry commented 5 years ago

Looks like it will work but be careful with comments and whitespace to improve readability. Ie get rid of the duplicate para in the big comment. Get rid of the slashes before the 2 lines in the comment (looks confusing) Indent each call to Dexter.move_all_joints by the same amount.

On Mon, Jul 1, 2019 at 4:01 PM scienceisalie notifications@github.com wrote:

/* Job Example 2 move_all_joints takes 5 angles in degrees, one for each of Dexter's joints. move_to takes an xyz position (in meters from Dexter's base), where you want the end effect to end up. Beware, the 2nd and 3rd args to move_to determine the ending J5_direction and which way the joints go. These are tricky to get right.

/ / Job Example 2 move_all_joints takes 5 angles in degrees, one for each of Dexter's joints. move_to takes an xyz position (in meters from Dexter's base), where you want the end effect to end up. Beware, the 2nd and 3rd args to move_to determine the ending J5_direction and which way the joints go. These are tricky to get right. */ new Job({name: "j2",

do_list: [Dexter.move_all_joints([90, 90, -45, 0, 0]),
       Dexter.move_all_joints([180, 90, -45, 0, 0]),
         Dexter.move_all_joints([270, 90, -45, 0, 0]),
         Dexter.move_all_joints([0, 90, -45, 0, 0])//angles
                  //J5_direction

         ]})

//After defining this Job by clicking the EVAL button, //click this job's button in the Output pane's header to start it.

//After defining this Job by clicking the EVAL button, //click this job's button in the Output pane's header to start it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JamesNewton/AdvancedRoboticsWithJavascript/issues/15?email_source=notifications&email_token=AAJBG7IGDPSL4E6GZE3LXK3P5JPBDA5CNFSM4H4VQ7NKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G4XCVTQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJBG7JQYJXMDUOUWEPFCSLP5JPBDANCNFSM4H4VQ7NA .