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

Added a gesture interface #54

Merged
merged 15 commits into from
Oct 28, 2015
Merged

Added a gesture interface #54

merged 15 commits into from
Oct 28, 2015

Conversation

rachelholladay
Copy link
Member

Adding the gesture interface for the demo. This involves:

  • some pre-computed trajectories for waving, stored in config/
  • a slightly simplified version of gestures in the action lib
  • the generic tsrs for gestures in tsr lib
  • a script file for a text interface to control the gestures

goal_name = None
else:
raise prpy.exceptions.PrPyException('Focus of the point is an \
unknown object')
Copy link
Member

Choose a reason for hiding this comment

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

This type inference is un-Pythonic and makes me nervous. For example, the "pointing at a point in space" logic will break if the user passes a list, tuple, or any other type of collection that is not an ndarray. This violates Python's affinity for duck typing.

I would prefer if you restructured this slightly:

  1. Make a Point action that takes focus_trans and (maybe, see above) a goal_name.
  2. Add PointAtKinBody and PointAtPoint functions for, respectively points and KinBody's
  3. If you think it is necessary, write a generic PointAt function that infers which PointAtX function to call.

Also, you should always use instanceof, not type equality checks to compare types.

@mkoval
Copy link
Member

mkoval commented Oct 15, 2015

Overall, this looks pretty good. I left a number of relatively minor comments, mostly about missing locks and RobotStateSavers.

@mkoval mkoval changed the title Feature/demo rogue Added a gesture interface Oct 15, 2015
"""
env = robot.GetEnv()
pointing_coord = GetPointFrom(env, focus)
Point(robot, pointing_coord, manip, render)
Copy link
Member

Choose a reason for hiding this comment

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

You should propagate the return value; i.e.

return Point(robot, pointing_coord, manip, render)

Copy link
Member

Choose a reason for hiding this comment

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

This applies to all of the wrapper functions.

p = openravepy.KinBody.SaveParameters
with robot.CreateRobotStateSaver(p.ActiveManipulator):
manip = robot.right_arm
robot.SetActiveManipulator(manip)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think you need to set the manipulator as active here.

@@ -1,2 +1,3 @@
from grasping import PushGrasp, Grasp
from rogue import *
Copy link
Member

Choose a reason for hiding this comment

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

import * is evil. Could you explicitly list the functions you wish to import here?

@mkoval
Copy link
Member

mkoval commented Oct 27, 2015

All of the major issues seem to be resolved. I just left a few comments on code cleanup.

@rachelholladay Could you also add (at least) one test to each of these functions that calls it on a very simple environment? It's fine if it's something as simple as just running each function on a Fuze bottle. We have a tutorial for doing this on the website and there are some simple examples in or_urdf.

@jeking04, @Shushman, or myself can help if you run into trouble.

@rachelholladay
Copy link
Member Author

@mkoval I made a PR on prpy for the util function, so I think that should be resolved first. I've also made most of the changes you asked for on this.

@mkoval
Copy link
Member

mkoval commented Oct 28, 2015

Thanks. The only comment I have left is that the default should always be GetActiveManipulator(), not right_arm. I'd much rather keep the Actions consistent than save a few characters of typing. Also, the current behavior will break if/when these functions support the left arm.

@rachelholladay
Copy link
Member Author

Alright @mkoval. Last comment addressed.


env, robot = herbpy.initialize(sim=True)
robot.right_arm.SetActive()
fuze = prpy.rave.add_object(env, 'fuze_bottle', 'objects/fuze_bottle.kinbody.xml')
Copy link
Member

Choose a reason for hiding this comment

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

This should occur in setUp, not in the file-level scope.

@rachelholladay
Copy link
Member Author

Testing addressed. Can we get it merged before class? :)

@mkoval mkoval closed this Oct 28, 2015
@mkoval mkoval reopened this Oct 28, 2015
mkoval added a commit that referenced this pull request Oct 28, 2015
@mkoval mkoval merged commit d5e8ab0 into personalrobotics:master Oct 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants