Skip to content

Commit

Permalink
pick & place parameters updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mrceki committed Mar 8, 2023
1 parent 69d3100 commit 992b238
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
18 changes: 9 additions & 9 deletions air_moveit_config/config/air_config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Total planning attempts
max_solutions: 10
max_solutions: 1000


# Planning group and link names
Expand All @@ -10,8 +10,8 @@ hand_frame: "qbhand_base_link"

# Poses
hand_open_pose: "open"
hand_close_pose: "closed"
arm_home_pose: "home"
hand_close_pose: "full_closed"
arm_home_pose: "up"

# Scene frames
world_frame: "world"
Expand All @@ -21,21 +21,21 @@ surface_link: "table"

# Collision object for picking
# CYLINDER object specifications
object_name: "object"
object_dimensions: [0.25, 0.02] # [height, radius]
object_name: "sphere"
object_dimensions: [0.05, 0.01] # [height, radius]
object_pose: [0.55, -0.25, 0.7, 0, 0, 0]

# Table model
spawn_table: true
spawn_table: True
table_name: "table"
table_dimensions: [0.4, 0.5, 0.2] # [length, width, height]
table_pose: [0.4, -0.21, 0.69, 0, 0, 0]

# Gripper grasp frame transform [x,y,z,r,p,y]
grasp_frame_transform: [0.0, 0.04, 0.13, -1.571, -1.571, 1.571]
grasp_frame_transform: [0.0, 0.07, 0.13, 1.571, 0, 0]

# Place pose [x,y,z,r,p,y]
place_pose: [0.45, -0.1, 0.7, 0, 0, 0]
place_pose: [0.59, -0.25, 0.82, 0, 0, 0]
place_surface_offset: 0.0005 # place offset from table

# Valid distance range when approaching an object for picking
Expand All @@ -44,4 +44,4 @@ approach_object_max_dist: 0.25

# Valid height range when lifting an object after pick
lift_object_min_dist: 0.00
lift_object_max_dist: 0.25
lift_object_max_dist: 0.15
8 changes: 7 additions & 1 deletion air_moveit_config/src/pick_place_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,31 @@ int main(int argc, char** argv) {
ros::AsyncSpinner spinner(1);
spinner.start();

moveit_task_constructor_demo::setupDemoScene(pnh);
//moveit_task_constructor_demo::setupDemoScene(pnh);

// Construct and run pick/place task
moveit_task_constructor_demo::PickPlaceTask pick_place_task("pick_place_task", pnh);
if (!pick_place_task.init()) {
ROS_INFO_NAMED(LOGNAME, "Initialization failed");
return 1;
}
else{
system("rosnode kill air_collision_publisher");
}

if (pick_place_task.plan()) {
ROS_INFO_NAMED(LOGNAME, "Planning succeded");
if (pnh.param("execute", false)) {
pick_place_task.execute();
ROS_INFO_NAMED(LOGNAME, "Execution complete");
system("rosrun air_moveit_config add_sphere");
} else {
ROS_INFO_NAMED(LOGNAME, "Execution disabled");
system("rosrun air_moveit_config add_sphere");
}
} else {
ROS_INFO_NAMED(LOGNAME, "Planning failed");
system("rosrun air_moveit_config add_sphere");
}

// Keep introspection alive
Expand Down
6 changes: 3 additions & 3 deletions air_moveit_config/src/pick_place_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ bool PickPlaceTask::init() {
// Set hand forward direction
geometry_msgs::Vector3Stamped vec;
vec.header.frame_id = hand_frame_;
vec.vector.z = 1.0;
vec.vector.y = 1.0;
stage->setDirection(vec);
grasp->insert(std::move(stage));
}
Expand Down Expand Up @@ -448,12 +448,12 @@ bool PickPlaceTask::init() {
{
auto stage = std::make_unique<stages::MoveRelative>("retreat after place", cartesian_planner);
stage->properties().configureInitFrom(Stage::PARENT, { "group" });
stage->setMinMaxDistance(.12, .25);
stage->setMinMaxDistance(.00, .05);
stage->setIKFrame(hand_frame_);
stage->properties().set("marker_ns", "retreat");
geometry_msgs::Vector3Stamped vec;
vec.header.frame_id = hand_frame_;
vec.vector.z = -1.0;
vec.vector.z = -0.05;
stage->setDirection(vec);
place->insert(std::move(stage));
}
Expand Down

0 comments on commit 992b238

Please sign in to comment.