콘텐츠 바로가기

Info
CM-900 Series is the embedded board with STM32F103C8 based on 32Bit ARM Cortext-M3 and its circuit diagram and the entire sources are open to public. At this very moment, CM-900 is developed and the prototype models are out in the market, and we plan to introduce newer version with bigger capacity in the future. If you think you can technically contribute to the devel… +more
Leader
Hi everyone I am leader of CM9 circle, developed prototype CM-900 h/w board(CM-900 is one of the CM9 serise) and integrated …+more
Created 2013-04-23 Members 188 Ranking 1 포인트 44,284
Interested Area > Robot H/W Design
USA
Using PyPose with the CM9_BC library (and setting up a Windows computer for PyPose)
Writer : NaN DATE : November 6, 2013 | Hit : 3,456
Installation:
1) (Windows) Download and install python 2.7 by going to http://python.org/download/ and selecting the latest version of the "Python 2.7.x Windows Installer".  Python serial port support is not great for 64-bit Windows, and any performance advantage of 64-bit python is not needed for PyPose.

2)  (Windows) Download and install wxPython by going to http://www.wxpython.org/download.php and selecting the latest version of "wxPython2.x-win32-unicode-py2.7" installer link (will have "32-bit Python 2.7" adjacent to the link).  If Python2.7 was installed correctly, the wxPython installer will produce no errors or warnings.  NOTE: wxPython does not support Python3 and the PyPose files have not been completely modified to be Python3 compatible.

3) 
(Windows) Download and install the latest version of PySerial by going to http://sourceforge.net/projects/pyserial/files/pyserial/2.7/ and selecting "pyserial-2.7.win32.exe".  Follow the on-screen instructions of the installer, and all should be well.

4) Download the latest version of PyPose (modified slightly to accommodate the hardware USB serial port of the CM9) by going to https://github.com/tician/pypose/ and clicking the "Download ZIP" button.  No installation is required.  Simply extract the contents to a convenient location and double-click on "pypose.py" to start the program (alternatively, open a command prompt, cd into the PyPose folder and run "python.exe pypose.py").

5) Open the CM9 IDE and upload the pypose sketch to the CM9 (File -> Examples -> CM9_BC -> pypose).

Using PyPose:
1) Connect the CM9 USB cable to the PC.

2) Start up PyPose as described in #4 above.

3) Select the correct serial port (config -> port).

4) Create a new project (project -> new).  In the pop-up window, type in a text name, verify the number of servos, and verify the servo resolution. 
PyPose will always use servo ID numbers starting at ID==1, so if you have a servo of ID==20, then will need to select 20 as number of servos.  PyPose also does not yet support mixed resolution servos; you cannot use AX/RX/EX servos (having a 10-bit potentiometer) together with MX servos (having a 12-bit magnetic encoder).  This should be resolved in a future project for creating motions (not PyPose or RoboPlus Motion).

5) Create a new pose by clicking the "add" button in the main window and entering a text name in the pop-up window.

5a) Capture current servo positions into the pose by using the "capture" button.  If the servos are not found, check that you have actually applied power to the servos and that no cables are damaged.
5b)
Turn off torque to the servos by using the "relax" button.
5c) Enable torque by using the "set" button after using the "capture" button to update the current servo positions in the pose, otherwise the servos will move to their last commanded position.
5d) Lather, Rinse, Repeat until you create a series of useful poses.
6) Create a new motion sequence by going to the "sequence editor tool" (tools -> sequence editor).
6a) Create a new sequence using the "add" button and entering a text name in the pop-up window.
6b) Create a new transition using the "new" button.
Each transition is a pose and a time length to move from the current servo positions to the servo positions specified in the pose.
A sequence is a series of transitions.
6c) Select a previously created pose for each transition from the drop-down list.
6d) Test a sequence by using the "run", "loop", and "halt" buttons.
7) Save the project (file -> save) and create a BioloidController compatible header file (tools -> export to header).
The version of PyPose in the tician/pypose repository should create header files compatible with the CM9_BC library, but may require a little bit of manual manipulation to make them easier for human readability.  PyPose also creates only a single header file instead of separating poses and sequences into two header files like the "mtn2cm9rpm.py" script.  These issues should be fixed sometime very soon.
PyPose does not create the RPM_Array necessary to use the new RoboPlus Motion

Using the headers in a sketch:
1) Create a new sketch, or modify an example sketch (tutorial_1 is poses, tutorial_2 is sequences).
2) Include the CM9_BC library (#include <CM9_BC.h>) and the newly created header file.
3) Follow the processes in the first two tutorial sketches in libraries' example folder.

Using a RoboPlus Motion file to create CM9_BC compatible headers:
1) Copy the RoboPlus Motion file to the CM9_BC/example folder, or copy the "mtn2cm9rpm.py" script to the folder containing the RoboPlus Motion file.

2) Open a terminal, cd to the folder containing both the python script and the RoboPlus Motion file, and run "python.exe mtn2cm9rpm.py -i TheInputRoboPlusMotionFile.mtn -p SomeSpecialNameToPrefixTheImportedPosesAndSequences".  Adding a "-T" or "--task" to the list of arguments will create an RPM_Array that will be directly compatible with the MotionPage numbers of a RoboPlus Task program using the same Motion file.

3) Copy the three header files to your sketch's folder, include the CM9_BC library (#include <CM9_BC.h>) and the RPM header (#include "HelloRobo_RPM.h"), and follow the processes used in the third tutorial and/or the soccer example.  The RPM header includes the Sequences header, which includes the Poses header.

NaN

Comment 5

Pandora 13-11-06 11:09 Comment
Hi NaN
it's kind tutorial!!! i'll try it.

Actually i have no experience using python and PyPose.

okay thank you.


Recommend0

Pandora 13-12-05 14:29 Comment
Hi NaN

I am testing new version of OpenCM IDE v1.0.1

but I encountered some problem in porting CM9_BC libraries from previous version you made.

the problem is that cm9_bc_example.ino cannot be built as resulting "can't find "transition_t" definition"

I would like to get a modified version based on v1.0.1 if you dont mind doing it.

Please consider once.

Thank you.

Recommend0

Metaball 13-12-09 07:46 Comment
Hi NaN



With the new CM 9.04 Board


I am testing new version of OpenCM IDE v1.0.1 too.



Everithing Ok but when I Start I have always the same problem



"Could not read servos"



I use >>>>>


 OpenCM IDE v1.0.1 beta release.



https://www.dropbox.com/s/p0ncltuuoanucb6/ROBOTIS-v1.0.1%20beta-windows.zip



I think the problem is with the point 5 of your present introduction; 5) Open the CM9 IDE and upload the pypose sketch to the CM9 (File -> Examples -> CM9_BC -> pypose).



Any idea of the probably problem.....



"Checksum found: 0

Oxff found

Oxff found

ID found: 253

Length found : 2

Error level found: 0

Checksum found: 0

Setting pose ..."

Setting pose size at 1



Thanks 

Recommend0

Metaball 13-12-12 02:30 Comment
Ok, Finally works perfect.


An stupit problem.



Good program and aplication. 



Congratulations and thanks for share it. I'm sure I'll use it and make amanzing things with my Prusa Mendell, AX-12, and the incredible CM 9.04.    



He we go.......

Recommend0

jorge 14-04-25 05:52 Comment
Hi NaN, great information. I'm able to run PyPose both on Windows and Linux, and seems to work (capture and relax do), but whenever I call "set pose" all the servos (5-dof arm) run to 0 position. PyPose output looks ok for the setPose function, but after that, when it tries to read again from the board, he complains he cannot find the 0xFF 0xFF that starts next message.

Any idea about what can be happening?
Thank you a lot

Here follows the output of set pose (failed) + relax (works):

Setting pose...
Setting pose size at 5
Oxff found
Oxff found
ID found: 253
Length found: 2
Error level found: 0
Checksum found: 0
Checksum computed: 255
Oxff NOT found, restart: 48
...many more...
Oxff NOT found, restart: 10
*** Fail Read ***
Oxff found
Oxff found
ID found: 253
Length found: 2
Error level found: 0
Checksum found: 0
Checksum computed: 255
Oxff found
Oxff found
ID found: 253
Length found: 2
Error level found: 0
Checksum found: 0
Checksum computed: 255
PyPose: relaxing servos...
*** Fail Read ***
Oxff found
Oxff found
ID found: 2
Length found: 2
Error level found: 0
Checksum found: 251
Checksum computed: 255
Oxff found
Oxff found
ID found: 3
Length found: 2
Error level found: 0
Checksum found: 250
Checksum computed: 255
Oxff found
Oxff found
ID found: 4
Length found: 2
Error level found: 0
Checksum found: 249
Checksum computed: 255
Oxff found
Oxff found
ID found: 5
Length found: 2
Error level found: 0
Checksum found: 248
Checksum computed: 255

Recommend0

Comment Cancel

  • CM9 Developer World
  • Member : 188
  • Circle Ranking : 1
  • Score : 44,284
  • Created Date : April 23, 2013

검색

Circle News

Members online(0)

Cooperating Circle
  • No Cooperating Circle