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 #62

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

sven-bock
Copy link

DigitalIO and Navigators

This little improvement enables you to see which buttons was pressed in your callback function.
Therefore you need only one callback function for all your buttons.
e.g.:

from baxter_interface.digital_io import DigitalIO
def updateState(*args):
    print "button pressed", args
button = DigitalIO("left_shoulder_button")
button.state_changed.connect(updateState)    

Camera

The current implementation raises an exception, if the camera is currently closed. I think it is useful in the camera controller to check, if the camera is opened or closed. Also in the past the service call to the camera list yielded all 3 cameras, which is not the case any more. Therefore I recommend to change the condition of the if in the init

…camera is not opened. This is useful to check, if a camera is opened or closed.
…wheel" and the button id or wheel position is sent in the arguments.

This is useful to use one callback for all buttons.
@rethink-imcmahon rethink-imcmahon changed the title Io state change button addition Additional info on state changes of buttons Sep 9, 2015
@@ -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"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The robot will now list all 3 cameras as services, so I don't see the benefit in hard-coding the camera names here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the old SDK a roservice call /cameras/list listed you all available cameras. In the new version you get exactly the opened cameras which are left_hand_camera and right_hand_camera by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants