How to add constraints to the moveit database?

asked 2019-01-22 03:20:42 -0500

boandlgrama gravatar image

I'm trying to add an orientation constraint to the moveit database so I can use it for benchmarking afterward.

My current steps are:

  1. Start my moveit/rviz launch file (equivalent to the default demo.launch of the moveit setup assistant) with the db:=true argument.

  2. Connect to the database in rviz

  3. Start my python script where I use the moveit_commander. The most important steps are:

    moveit_commander.roscpp_initialize(sys.argv)
    self.robot = moveit_commander.RobotCommander()
    self.scene = moveit_commander.PlanningSceneInterface()
    self.move_group = moveit_commander.MoveGroupCommander('box_gripper')
    self.move_group.set_constraints_database(
        '127.0.0.1', 33829)
    
    constraint = Constraints()
    constraint.name = "tilt constraint"
    tilt_constraint = OrientationConstraint()
    tilt_constraint.header.frame_id = "base_link"
    tilt_constraint.link_name = "box_gripper_link"
    tilt_constraint.orientation = Quaternion(0.5, 0.5, 0.5, 0.5)
    tilt_constraint.absolute_x_axis_tolerance = pi / 3
    tilt_constraint.absolute_y_axis_tolerance = pi
    tilt_constraint.absolute_z_axis_tolerance = pi / 4
    tilt_constraint.weight = 1
    constraint.orientation_constraints = [tilt_constraint]
    self.move_group.set_path_constraints(constraint)
    

During these steps, I get no errors but the constraint doesn't appear in the rviz drop-down list.

Are there some steps missing?

Or is it not possible at all with the moveit_commadner?

edit retag flag offensive close merge delete