darwin_walk_backward
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
darwin_walk_backward [2017/11/20 17:18] – [Programming] yuhanghe | darwin_walk_backward [2017/11/21 11:37] (current) – [Programming] yuhanghe | ||
---|---|---|---|
Line 10: | Line 10: | ||
{{ :: | {{ :: | ||
\\ | \\ | ||
- | This tutorial will demonstrate how to program Darwin OP 2 to walk backward. The walking algorithm for backward motion is included in Darwin OP 2's source code by Robotis. However, there is no on-line, or barely any, documentation of this process. This tutorial take approximately 1 hour to complete. | + | This tutorial will demonstrate how to program Darwin OP 2 to walk backward. The walking algorithm for backward motion is included in Darwin OP 2's source code by Robotis. However, there is no on-line, or barely any, documentation of this process. This tutorial |
\\ | \\ | ||
===== Motivation and Audience ===== | ===== Motivation and Audience ===== | ||
- | This tutorial' | + | This tutorial' |
* Familiar with handling Darwin OP 2 | * Familiar with handling Darwin OP 2 | ||
Line 29: | Line 29: | ||
===== Programming ===== | ===== Programming ===== | ||
- | Following a target | + | Darwin OP 2's Walking class calculates motor positions for walking algorithm internally based on parameters. Most of these parameters |
- | \\ | + | \\ \\ |
- | This tutorial will only demonstrate parts of program that needs modification to include program | + | There are 3 parameter in walking_tuner |
+ | \\ \\ | ||
+ | Below is a sample | ||
<code cpp | main.cpp> | <code cpp | main.cpp> | ||
Line 38: | Line 41: | ||
#include < | #include < | ||
#include < | #include < | ||
+ | #include " | ||
#define INI_FILE_PATH | #define INI_FILE_PATH | ||
Line 61: | Line 65: | ||
//////////////////// | //////////////////// | ||
+ | LinuxCM730 linux_cm730(U2D_DEV_NAME); | ||
CM730 cm730(& | CM730 cm730(& | ||
if(MotionManager:: | if(MotionManager:: | ||
Line 67: | Line 72: | ||
return 0; | return 0; | ||
} | } | ||
- | | + | //Port initialization and opening, dynamixel power on |
- | Walking:: | + | |
+ | | ||
+ | Walking:: | ||
+ | //Load default settings for MotionManager and Walking module | ||
MotionManager:: | MotionManager:: | ||
MotionManager:: | MotionManager:: | ||
- | | + | |
- | motion_timer-> | + | motion_timer-> |
+ | //Create MotionManager object and registers head and walking modules, then timers are initialized. | ||
///////////////////////////////////////////////////////////////////// | ///////////////////////////////////////////////////////////////////// | ||
+ | ///////////////////////// | ||
int n = 0; | int n = 0; | ||
int param[JointData:: | int param[JointData:: | ||
Line 100: | Line 110: | ||
} | } | ||
cm730.SyncWrite(MX28:: | cm730.SyncWrite(MX28:: | ||
+ | //Capture initial position of Darwin OP 2's motor position | ||
+ | | ||
printf(" | printf(" | ||
getchar(); | getchar(); | ||
- | | + | |
- | Walking:: | + | Walking:: |
MotionManager:: | MotionManager:: | ||
+ | //Walking and MotionManager enable motors | ||
while(1) | while(1) | ||
Line 117: | Line 129: | ||
if(Walking:: | if(Walking:: | ||
- | Walking:: | + | Walking:: |
+ | // | ||
+ | //each unit corresponds to approximately 1 mm. Set X_MOVE_AMPLITUDE to negative numbers to program | ||
+ | //Darwin OP 2 to walk backwards. The Walking class calculates corresponding motor positions | ||
+ | // | ||
+ | | ||
Walking:: | Walking:: | ||
+ | // | ||
+ | //unit correspond approximately to 1 degree. Positive degrees for Darwin OP 2 to turn | ||
+ | // | ||
+ | | ||
Walking:: | Walking:: | ||
+ | //Start walking algorithm | ||
} | } | ||
- | Walking:: | + | Walking:: |
Walking:: | Walking:: | ||
+ | | ||
} | } | ||
Line 132: | Line 155: | ||
</ | </ | ||
- | <code make | MakeFile> | + | <code make | Makefile> |
- | ############################################################### | + | |
- | # | + | |
- | # Purpose: | + | |
- | # Author.: robotis (edited by Yu Hang) | + | |
- | # Version: 0.1 | + | |
- | # License: GPL | + | |
- | # | + | |
- | ############################################################### | + | |
TARGET = walk_backward | TARGET = walk_backward | ||
Line 177: | Line 192: | ||
===== Demonstration ===== | ===== Demonstration ===== | ||
- | In this demonstration, | + | In this demonstration, |
- | {{ youtube>HaZladeEsJo?large }} | + | {{ youtube>GQ8AyZpQ9NU?large }} |
===== Final Words ===== | ===== Final Words ===== | ||
- | This tutorial' | + | This tutorial' |
\\ | \\ | ||
\\ | \\ |
darwin_walk_backward.1511227081.txt.gz · Last modified: by yuhanghe