Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional info on state changes of buttons #60

Closed
wants to merge 7 commits into from
2 changes: 1 addition & 1 deletion src/baxter_interface/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(self, name):

list_svc = rospy.ServiceProxy('/cameras/list', ListCameras)
rospy.wait_for_service('/cameras/list', timeout=10)
if not self._id in list_svc().cameras:
if not self._id in ["left_hand_camera","right_hand_camera","head_camera"]:
raise AttributeError(
("Cannot locate a service for camera name '{0}'. "
"Close a different camera first and try again.".format(self._id)))
Expand Down
2 changes: 1 addition & 1 deletion src/baxter_interface/digital_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _on_io_state(self, msg):

# trigger signal if changed
if old_state is not None and old_state != new_state:
self.state_changed(new_state)
self.state_changed(new_state,self._id)

@property
def is_output(self):
Expand Down
6 changes: 3 additions & 3 deletions src/baxter_interface/navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,11 @@ def _on_state(self, msg):
]
for i, signal in enumerate(buttons):
if old_state.buttons[i] != msg.buttons[i]:
signal(msg.buttons[i])
signal(msg.buttons[i],self._id,"button",i)

if old_state.wheel != msg.wheel:
diff = msg.wheel - old_state.wheel
if abs(diff % 256) < 127:
self.wheel_changed(diff % 256)
self.wheel_changed(diff % 256,self._id,"wheel",msg.wheel)
else:
self.wheel_changed(diff % (-256))
self.wheel_changed(diff % (-256),self._id,"wheel",msg.wheel)