Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
alejomancinelli committed Aug 1, 2024
1 parent 141d5ac commit 7d96c26
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@ Then, the request is created:
service_request->request.items.push_back(item1);
service_request->request.items.push_back(item2);

Service call and response. The method ``future.wait_for(timeout_duration)`` waits for the
result to become available. The method blocks until specified ``timeout_duration`` has elapsed or the
result becomes available, whichever comes first. The return value identifies the state of
the result. This is perform every 1 seconds until the future is ready.
Once the service call is completed, the method ``future.wait_for(timeout_duration)`` blocks until
a specified ``timeout_duration`` has elapsed or the result becomes available, whichever comes
first. The return value identifies the state of the result. This is performed every second
until the future is ready.


::
Expand Down Expand Up @@ -589,7 +589,7 @@ Then, the request is created:
sequence_request.items.push_back(item1);
sequence_request.items.push_back(item2);

Create goal and planning options. A goal response callback and result callback can be included as well.
The goal and planning options are configured. A goal response callback and result callback can be included as well.

::

Expand All @@ -600,7 +600,7 @@ Create goal and planning options. A goal response callback and result callback c
// Planning options
goal_msg.planning_options.planning_scene_diff.is_diff = true;
goal_msg.planning_options.planning_scene_diff.robot_state.is_diff = true;
// goal_msg.planning_options.plan_only = true;
// goal_msg.planning_options.plan_only = true; // Uncomment to only plan the trajectory

Finally, send the goal request and wait for the response:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int main(int argc, char** argv)
// MotionSequenceItem configuration
item1.req.group_name = PLANNING_GROUP;
item1.req.planner_id = "LIN";
item1.req.allowed_planning_time = 5;
item1.req.allowed_planning_time = 5.0;
item1.req.max_velocity_scaling_factor = 0.1;
item1.req.max_acceleration_scaling_factor = 0.1;

Expand All @@ -93,9 +93,9 @@ int main(int argc, char** argv)
msg.pose.position.y = -0.2;
msg.pose.position.z = 0.6;
msg.pose.orientation.x = 1.0;
msg.pose.orientation.y = 0;
msg.pose.orientation.z = 0;
msg.pose.orientation.w = 0;
msg.pose.orientation.y = 0.0;
msg.pose.orientation.z = 0.0;
msg.pose.orientation.w = 0.0;
return msg;
}();
item1.req.goal_constraints.push_back(
Expand All @@ -107,12 +107,12 @@ int main(int argc, char** argv)

// Set pose blend radius
// For the last pose, it must be 0!
item2.blend_radius = 0;
item2.blend_radius = 0.0;

// MotionSequenceItem configuration
item2.req.group_name = PLANNING_GROUP;
item2.req.planner_id = "LIN";
item2.req.allowed_planning_time = 5;
item2.req.allowed_planning_time = 5.0;
item2.req.max_velocity_scaling_factor = 0.1;
item2.req.max_acceleration_scaling_factor = 0.1;

Expand All @@ -124,9 +124,9 @@ int main(int argc, char** argv)
msg.pose.position.y = -0.2;
msg.pose.position.z = 0.8;
msg.pose.orientation.x = 1.0;
msg.pose.orientation.y = 0;
msg.pose.orientation.z = 0;
msg.pose.orientation.w = 0;
msg.pose.orientation.y = 0.0;
msg.pose.orientation.z = 0.0;
msg.pose.orientation.w = 0.0;
return msg;
}();
item2.req.goal_constraints.push_back(
Expand Down Expand Up @@ -231,7 +231,7 @@ int main(int argc, char** argv)
// Planning options
goal_msg.planning_options.planning_scene_diff.is_diff = true;
goal_msg.planning_options.planning_scene_diff.robot_state.is_diff = true;
// goal_msg.planning_options.plan_only = true;
// goal_msg.planning_options.plan_only = true; // Uncomment to only plan the trajectory

// Goal response callback
auto send_goal_options = rclcpp_action::Client<MoveGroupSequence>::SendGoalOptions();
Expand Down Expand Up @@ -273,13 +273,6 @@ int main(int argc, char** argv)
RCLCPP_INFO(LOGGER, "Result received");
};

// Feedback callback
// It does not show the state of the sequence, but the state of the robot: PLANNING, MONITOR, IDLE
send_goal_options.feedback_callback = [](GoalHandleMoveGroupSequence::SharedPtr,
const std::shared_ptr<const GoalHandleMoveGroupSequence::Feedback> feedback) {
RCLCPP_INFO(LOGGER, "Feedback: %s", feedback->state.c_str());
};

// Send the action goal
auto goal_handle_future = action_client->async_send_goal(goal_msg, send_goal_options);

Expand Down

0 comments on commit 7d96c26

Please sign in to comment.