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

Grasplan base module #17

Open
jarkenau opened this issue Apr 9, 2024 · 1 comment
Open

Grasplan base module #17

jarkenau opened this issue Apr 9, 2024 · 1 comment
Assignees

Comments

@jarkenau
Copy link
Member

jarkenau commented Apr 9, 2024

I think we should create a base module that handles some common initialization for the place, pick and insert actions. For example each actions needs the interfaces to MoveIt!:

try:
rospy.loginfo('waiting for move_group action server')
moveit_commander.roscpp_initialize(sys.argv)
self.robot = moveit_commander.RobotCommander()
self.robot.arm.set_planning_time(self.planning_time)
self.robot.arm.set_goal_tolerance(arm_goal_tolerance)
self.scene = moveit_commander.PlanningSceneInterface()
rospy.loginfo('found move_group action server')
except RuntimeError:
rospy.logfatal(
'grasplan place server could not connect to Moveit in time, exiting! \n' + traceback.format_exc()
)
rospy.signal_shutdown('fatal error')

try:
rospy.loginfo('waiting for move_group action server')
moveit_commander.roscpp_initialize(sys.argv)
self.robot = moveit_commander.RobotCommander()
self.gripper = getattr(self.robot, gripper_group_name)
self.robot.arm.set_planning_time(self.planning_time)
self.robot.arm.set_goal_tolerance(arm_goal_tolerance)
self.scene = moveit_commander.PlanningSceneInterface()
rospy.loginfo('found move_group action server')
except RuntimeError:
# moveit_commander.roscpp_initialize overwrites the signal handler,
# so if a RuntimeError occurs here, we have to manually call
# signal_shutdown() in order for the node to properly exit.
rospy.logfatal(
'grasplan pick server could not connect to Moveit in time, exiting! \n' + traceback.format_exc()
)
rospy.signal_shutdown('fatal error')

a tf client etc, ....

@jarkenau jarkenau self-assigned this Apr 9, 2024
@oscar-lima
Copy link
Collaborator

very good idea! we could do that with inheritance, having a (singleton?) base class that initializes the necessary modules.

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

No branches or pull requests

2 participants