small changes.
This commit is contained in:
parent
063ab4fd43
commit
0e472841a3
39
config.py
39
config.py
@ -105,7 +105,7 @@ R_MAX = 0.75
|
|||||||
THETA_MIN= -TABLE_ARC/2
|
THETA_MIN= -TABLE_ARC/2
|
||||||
THETA_MAX = TABLE_ARC/2
|
THETA_MAX = TABLE_ARC/2
|
||||||
Z_MIN = TABLE_Z + 0.5*BLOCK_DIM
|
Z_MIN = TABLE_Z + 0.5*BLOCK_DIM
|
||||||
Z_MAX = TABLE_Z + 4.5*BLOCK_DIM #4 blocks high
|
Z_MAX = TABLE_Z + 2*BLOCK_DIM
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -123,19 +123,7 @@ Z_MAX = TABLE_Z + 4.5*BLOCK_DIM #4 blocks high
|
|||||||
# RB:5
|
# RB:5
|
||||||
# Back:6
|
# Back:6
|
||||||
# Start:7
|
# Start:7
|
||||||
BUTTON_MAP = {
|
#
|
||||||
4: (0, 0, -1),
|
|
||||||
5: (0, 0, 1)
|
|
||||||
}
|
|
||||||
# Hat switch:0 (All or nothing for direction). returns (+-1, +-1) = (+-x. +-y)
|
|
||||||
# hx, hy = hat
|
|
||||||
HATCODE = 0 #set to -1 to avoid polling hat
|
|
||||||
HX = 10
|
|
||||||
HY = 11
|
|
||||||
HAT_MAP = {
|
|
||||||
HX: (0, 1, 0),
|
|
||||||
HY: (-1, 0, 0) #inverted
|
|
||||||
}
|
|
||||||
# Axes (Not supported)
|
# Axes (Not supported)
|
||||||
# Joystick left, x-axis:0
|
# Joystick left, x-axis:0
|
||||||
# Joystick left, y-axis:1
|
# Joystick left, y-axis:1
|
||||||
@ -143,7 +131,30 @@ HAT_MAP = {
|
|||||||
# Joystick right, x-axis:4
|
# Joystick right, x-axis:4
|
||||||
# Left trigger:2
|
# Left trigger:2
|
||||||
# Right trigger:5
|
# Right trigger:5
|
||||||
|
#
|
||||||
|
# Hat switch:0 (All or nothing for direction). returns (+-1, +-1) = (+-x. +-y)
|
||||||
|
# hx, hy = hat
|
||||||
|
|
||||||
|
HATCODE = -1 #set to -1 to avoid polling hat
|
||||||
|
HX = 10
|
||||||
|
HY = 11
|
||||||
|
HAT_MAP = {
|
||||||
|
HX: (0,1,0),
|
||||||
|
HY: (-1,0,0) #inverted
|
||||||
|
}
|
||||||
|
|
||||||
|
#BUTTON_MAP = {
|
||||||
|
# 4: (0,0,-1),
|
||||||
|
# 5: (0,0,1)
|
||||||
|
#}
|
||||||
|
BUTTON_MAP = { #Buttons only (no hat)
|
||||||
|
0: (1,0,0),
|
||||||
|
3: (-1,0,0),
|
||||||
|
1: (0,1,0),
|
||||||
|
2: (0,-1,0),
|
||||||
|
4: (0,0,-1),
|
||||||
|
5: (0,0,1)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# AUTO/LOOP CONTROL
|
# AUTO/LOOP CONTROL
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
# This config file is the one tested and tuned during development.
|
# This is a backup of a working demo configuration.
|
||||||
# Revert to this to reset parameters.
|
# Reset parameters by reverting to this.
|
||||||
import math
|
import math
|
||||||
|
|
||||||
DEBUG = True
|
DEBUG = True
|
||||||
@ -88,6 +88,9 @@ T_FORCE_VIOLATION = 0.3
|
|||||||
# Note that the angular velocity is also [m/s], not [rad/s], to ensure that the robot
|
# Note that the angular velocity is also [m/s], not [rad/s], to ensure that the robot
|
||||||
# moves with constant speed regardless of direction in the polar plane.
|
# moves with constant speed regardless of direction in the polar plane.
|
||||||
# IMPORTANT: VEL_Z should be tuned to Z_MIN to avoid smashing into the table.
|
# IMPORTANT: VEL_Z should be tuned to Z_MIN to avoid smashing into the table.
|
||||||
|
#
|
||||||
|
# T_DIR_CHANGE_COOLDOWN is a cooldown between change of commands. With this, the robot
|
||||||
|
# have a chance to decelerate before changing direction, which smooths out motion.
|
||||||
VEL = 0.1 #[m/s]
|
VEL = 0.1 #[m/s]
|
||||||
VEL_Z = 0.05 #[m/s]
|
VEL_Z = 0.05 #[m/s]
|
||||||
ACC = 0.5 #[m/s^2]
|
ACC = 0.5 #[m/s^2]
|
||||||
@ -104,10 +107,58 @@ R_MAX = 0.75
|
|||||||
THETA_MIN= -TABLE_ARC/2
|
THETA_MIN= -TABLE_ARC/2
|
||||||
THETA_MAX = TABLE_ARC/2
|
THETA_MAX = TABLE_ARC/2
|
||||||
Z_MIN = TABLE_Z + 0.5*BLOCK_DIM
|
Z_MIN = TABLE_Z + 0.5*BLOCK_DIM
|
||||||
Z_MAX = TABLE_Z + 4.5*BLOCK_DIM #4 blocks high
|
Z_MAX = TABLE_Z + 2*BLOCK_DIM
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# GAMEPAD MAP
|
||||||
|
#
|
||||||
|
# For the Microsoft xBox 360 controller. Button/axes codes are listed
|
||||||
|
# below for reference.
|
||||||
|
#
|
||||||
|
# Buttons
|
||||||
|
# A:0
|
||||||
|
# B:1
|
||||||
|
# X:2
|
||||||
|
# Y:3
|
||||||
|
# LB:4
|
||||||
|
# RB:5
|
||||||
|
# Back:6
|
||||||
|
# Start:7
|
||||||
|
#
|
||||||
|
# Axes (Not supported)
|
||||||
|
# Joystick left, x-axis:0
|
||||||
|
# Joystick left, y-axis:1
|
||||||
|
# Joystick right, x-axis:3
|
||||||
|
# Joystick right, x-axis:4
|
||||||
|
# Left trigger:2
|
||||||
|
# Right trigger:5
|
||||||
|
#
|
||||||
|
# Hat switch:0 (All or nothing for direction). returns (+-1, +-1) = (+-x. +-y)
|
||||||
|
# hx, hy = hat
|
||||||
|
|
||||||
|
HATCODE = -1 #set to -1 to avoid polling hat
|
||||||
|
HX = 10
|
||||||
|
HY = 11
|
||||||
|
HAT_MAP = {
|
||||||
|
HX: (0,1,0),
|
||||||
|
HY: (-1,0,0) #inverted
|
||||||
|
}
|
||||||
|
|
||||||
|
#BUTTON_MAP = {
|
||||||
|
# 4: (0,0,-1),
|
||||||
|
# 5: (0,0,1)
|
||||||
|
#}
|
||||||
|
BUTTON_MAP = { #Buttons only (no hat)
|
||||||
|
0: (1,0,0),
|
||||||
|
3: (-1,0,0),
|
||||||
|
1: (0,1,0),
|
||||||
|
2: (0,-1,0),
|
||||||
|
4: (0,0,-1),
|
||||||
|
5: (0,0,1)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# AUTO/LOOP CONTROL
|
# AUTO/LOOP CONTROL
|
||||||
#
|
#
|
||||||
# When looping, the robot use the same velocity for r, theta and z.
|
# When looping, the robot use the same velocity for r, theta and z.
|
||||||
|
|||||||
BIN
config.pyc
BIN
config.pyc
Binary file not shown.
@ -292,7 +292,7 @@ class DemoController(object):
|
|||||||
v = [pose1[i]-pose0[i] for i in range(len(pose0))]
|
v = [pose1[i]-pose0[i] for i in range(len(pose0))]
|
||||||
if self.debug:
|
if self.debug:
|
||||||
_sum = sum(map(abs, v))
|
_sum = sum(map(abs, v))
|
||||||
print "Velocity vector, dt=%.2f: %s. SUM %.3f" % (dt, str([('%.2f' % i) for i in v]), _sum)
|
print "dt = %.2f, v = ds/dt = %s, |v| = %.3f" % (dt, str([('%.2f' % i) for i in v]), _sum)
|
||||||
return sum(map(abs, v)) > threshold
|
return sum(map(abs, v)) > threshold
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user