Skip to content

Commit

Permalink
Merge pull request #16 from ROBOTIS-GIT/hotfixes
Browse files Browse the repository at this point in the history
Hotfixes for python example codes
  • Loading branch information
LeonJung authored Jul 1, 2016
2 parents ef7967b + 42d0c63 commit 36e4fad
Show file tree
Hide file tree
Showing 17 changed files with 180 additions and 106 deletions.
10 changes: 10 additions & 0 deletions ReleaseNote.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
==============================================
Dynamixel SDK v3.3.2 (Protocol 1.0/2.0)
==============================================

- 06.30.2016

* SDK Python strange printout problem solved

* Solved issue : #3, #8

==============================================
Dynamixel SDK v3.3.1 (Protocol 1.0/2.0)
==============================================
Expand Down
16 changes: 10 additions & 6 deletions python/protocol1_0/bulk_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@
# Be sure that Dynamixel MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000)
#

import os, sys, ctypes
import os, ctypes

if os.name == 'nt':
import msvcrt
def getch():
return msvcrt.getch().decode()
else:
import tty, termios
import sys, tty, termios
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(sys.stdin.fileno())
def getch():
return sys.stdin.read(1)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

os.sys.path.append('../dynamixel_functions_py') # Path setting

Expand Down Expand Up @@ -95,7 +99,7 @@ def getch():
else:
print("Failed to open the port!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand All @@ -105,7 +109,7 @@ def getch():
else:
print("Failed to change the baudrate!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand Down
20 changes: 12 additions & 8 deletions python/protocol1_0/factory_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@
# This example resets all properties of Dynamixel to default values, such as %% ID : 1 / Baudnum : 34 (Baudrate : 57600)
#

import os, sys
import os

if os.name == 'nt':
import msvcrt
def getch():
return msvcrt.getch().decode()
else:
import tty, termios
import sys, tty, termios
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(sys.stdin.fileno())
def getch():
return sys.stdin.read(1)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

os.sys.path.append('../dynamixel_functions_py') # Path setting

Expand Down Expand Up @@ -79,7 +83,7 @@ def getch():
else:
print("Failed to open the port!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand All @@ -89,7 +93,7 @@ def getch():
else:
print("Failed to change the baudrate!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand Down Expand Up @@ -118,7 +122,7 @@ def getch():
print("Succeed to change the controller baudrate to : %d" % (FACTORYRST_DEFAULTBAUDRATE))
else:
print("Failed to change the controller baudrate")
msvcrt.getch()
getch()
quit()

# Read Dynamixel baudnum
Expand All @@ -144,7 +148,7 @@ def getch():
print("Succeed to change the controller baudrate to : %d" % (BAUDRATE))
else:
print("Failed to change the controller baudrate")
msvcrt.getch()
getch()
quit()

sleep(0.2)
Expand Down
20 changes: 12 additions & 8 deletions python/protocol1_0/multi_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@
# Be sure that Dynamixel MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000 [1M])
#

import os, sys
import os

if os.name == 'nt':
import msvcrt
def getch():
return msvcrt.getch().decode()
else:
import tty, termios
import sys, tty, termios
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(sys.stdin.fileno())
def getch():
return sys.stdin.read(1)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

os.sys.path.append('../dynamixel_functions_py') # Path setting

Expand Down Expand Up @@ -85,7 +89,7 @@ def getch():
else:
print("Failed to open the port!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()

# Open port2
Expand All @@ -94,7 +98,7 @@ def getch():
else:
print("Failed to open the port!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand All @@ -104,7 +108,7 @@ def getch():
else:
print("Failed to change the baudrate!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()

# Set port2 baudrate
Expand All @@ -113,7 +117,7 @@ def getch():
else:
print("Failed to change the baudrate!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand Down
16 changes: 10 additions & 6 deletions python/protocol1_0/ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@
# Be sure that Dynamixel MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000 [1M])
#

import os, sys
import os

if os.name == 'nt':
import msvcrt
def getch():
return msvcrt.getch().decode()
else:
import tty, termios
import sys, tty, termios
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(sys.stdin.fileno())
def getch():
return sys.stdin.read(1)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

os.sys.path.append('../dynamixel_functions_py') # Path setting

Expand Down Expand Up @@ -64,7 +68,7 @@ def getch():
else:
print("Failed to open the port!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()

# Set port baudrate
Expand All @@ -73,7 +77,7 @@ def getch():
else:
print("Failed to change the baudrate!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand Down
16 changes: 10 additions & 6 deletions python/protocol1_0/read_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@
# Be sure that Dynamixel MX properties are already set as ## ID : 1 / Baudnum : 1 (Baudrate : 1000000 [1M])
#

import os, sys
import os

if os.name == 'nt':
import msvcrt
def getch():
return msvcrt.getch().decode()
else:
import tty, termios
import sys, tty, termios
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(sys.stdin.fileno())
def getch():
return sys.stdin.read(1)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

os.sys.path.append('../dynamixel_functions_py') # Path setting

Expand Down Expand Up @@ -82,7 +86,7 @@ def getch():
else:
print("Failed to open the port!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()

# Set port baudrate
Expand All @@ -91,7 +95,7 @@ def getch():
else:
print("Failed to change the baudrate!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand Down
16 changes: 10 additions & 6 deletions python/protocol1_0/sync_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@
# Be sure that Dynamixel MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000 [1M])
#

import os, sys, ctypes
import os, ctypes

if os.name == 'nt':
import msvcrt
def getch():
return msvcrt.getch().decode()
else:
import tty, termios
import sys, tty, termios
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(sys.stdin.fileno())
def getch():
return sys.stdin.read(1)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

os.sys.path.append('../dynamixel_functions_py') # Path setting

Expand Down Expand Up @@ -91,7 +95,7 @@ def getch():
else:
print("Failed to open the port!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()

# Set port baudrate
Expand All @@ -100,7 +104,7 @@ def getch():
else:
print("Failed to change the baudrate!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()


Expand Down
16 changes: 10 additions & 6 deletions python/protocol2_0/broadcast_ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@
# Be sure that Dynamixel PRO properties are already set as %% ID : 1 / Baudnum : 3 (Baudrate : 1000000 [1M])
#

import os, sys, ctypes
import os, ctypes

if os.name == 'nt':
import msvcrt
def getch():
return msvcrt.getch().decode()
else:
import tty, termios
import sys, tty, termios
fd = sys.stdin.fileno()
old_settings = termios.tcgetattr(fd)
tty.setraw(sys.stdin.fileno())
def getch():
return sys.stdin.read(1)
try:
tty.setraw(sys.stdin.fileno())
ch = sys.stdin.read(1)
finally:
termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
return ch

os.sys.path.append('../dynamixel_functions_py') # Path setting

Expand Down Expand Up @@ -65,7 +69,7 @@ def getch():
else:
print("Failed to open the port!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()

# Set port baudrate
Expand All @@ -74,7 +78,7 @@ def getch():
else:
print("Failed to change the baudrate!")
print("Press any key to terminate...")
msvcrt.getch()
getch()
quit()

# Try to broadcast ping the Dynamixel
Expand Down
Loading

0 comments on commit 36e4fad

Please sign in to comment.