Skip to content

Commit

Permalink
pre-commit fix and gotten max_solution_number parametrically
Browse files Browse the repository at this point in the history
  • Loading branch information
CihatAltiparmak committed Aug 14, 2024
1 parent 2750807 commit ce19cc1
Show file tree
Hide file tree
Showing 7 changed files with 489 additions and 488 deletions.
1 change: 0 additions & 1 deletion config/pick_place_demo_configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@
# Valid height range when lifting an object after pick
lift_object_min_dist: 0.01
lift_object_max_dist: 0.1

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@

#pragma once

namespace moveit_task_constructor_demo {
namespace moveit_task_constructor_demo
{
using namespace moveit::task_constructor;

// prepare a demo environment from ROS parameters under node
Expand All @@ -73,18 +74,17 @@ void destroyDemoScene(const pick_place_task_demo::Params& params);
class PickPlaceTask
{
public:
PickPlaceTask(const std::string& task_name);
~PickPlaceTask() = default;
PickPlaceTask(const std::string& task_name);
~PickPlaceTask() = default;

bool init(const rclcpp::Node::SharedPtr& node, const pick_place_task_demo::Params& params);
bool init(const rclcpp::Node::SharedPtr& node, const pick_place_task_demo::Params& params);

bool plan(const std::size_t max_solutions);
bool plan(const std::size_t max_solutions);

bool execute();
bool execute();

private:
std::string task_name_;
moveit::task_constructor::TaskPtr task_;
std::string task_name_;
moveit::task_constructor::TaskPtr task_;
};
} // namespace moveit_task_constructor_demo

Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
#include <benchmark/benchmark.h>
#include <memory>

#include <ament_index_cpp/get_package_share_directory.hpp>

#include <moveit/moveit_cpp/moveit_cpp.h>
#include <moveit/moveit_cpp/planning_component.h>
#include <moveit/move_group_interface/move_group_interface.h>

#include "moveit_middleware_benchmark/scenarios/moveit_task_constructor/pick_place_task.hpp"

namespace
Expand All @@ -63,7 +57,7 @@ namespace middleware_benchmark
class ScenarioMoveItTaskConstructor
{
public:
ScenarioMoveItTaskConstructor(const rclcpp::Node::SharedPtr & node);
ScenarioMoveItTaskConstructor(const rclcpp::Node::SharedPtr& node);
~ScenarioMoveItTaskConstructor();

void runTestCase();
Expand Down Expand Up @@ -91,4 +85,4 @@ class ScenarioMoveItTaskConstructorFixture : public benchmark::Fixture
};

} // namespace middleware_benchmark
} // namespace moveit
} // namespace moveit
33 changes: 6 additions & 27 deletions launch/scenario_moveit_task_constructor_benchmark.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,21 @@ def launch_setup(context, *args, **kwargs):
publish_robot_description=True, publish_robot_description_semantic=True
)
.trajectory_execution(file_path="config/gripper_moveit_controllers.yaml")
.planning_pipelines(
pipelines=["ompl"]
)
.planning_pipelines(pipelines=["ompl"])
.to_moveit_configs()
)

# RViz for DEBUGGING STUFFS
rviz_config_file = (
get_package_share_directory("moveit_task_constructor_demo") + "/config/mtc.rviz"
)
rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="log",
arguments=["-d", rviz_config_file],
parameters=[
moveit_config.robot_description,
moveit_config.robot_description_semantic,
moveit_config.robot_description_kinematics,
moveit_config.planning_pipelines,
],
)

# Load ExecuteTaskSolutionCapability so we can execute found solutions in simulation
move_group_capabilities = {"capabilities": "move_group/ExecuteTaskSolutionCapability"}
move_group_capabilities = {
"capabilities": "move_group/ExecuteTaskSolutionCapability"
}

# Start the actual move_group node/action server
move_group_node = Node(
package="moveit_ros_move_group",
executable="move_group",
output="screen",
parameters=[moveit_config.to_dict(),
move_group_capabilities],
parameters=[moveit_config.to_dict(), move_group_capabilities],
arguments=["--ros-args", "--log-level", "info"],
)

Expand Down Expand Up @@ -161,7 +142,6 @@ def launch_setup(context, *args, **kwargs):
joint_state_broadcaster_spawner,
panda_arm_controller_spawner,
panda_hand_controller_spawner,
rviz_node,
# for https://github.com/ros-controls/ros2_controllers/issues/981
RegisterEventHandler(
OnProcessExit(
Expand All @@ -182,7 +162,7 @@ def generate_launch_description():

benchmark_command_args = DeclareLaunchArgument(
"benchmark_command_args",
default_value="--benchmark_out=middleware_benchmark_results.json --benchmark_out_format=json --benchmark_repetitions=6",
default_value="--benchmark_out=middleware_benchmark_results.json --benchmark_out_format=json --benchmark_repetitions=20",
description="Google Benchmark Tool Arguments",
)
declared_arguments.append(benchmark_command_args)
Expand All @@ -197,4 +177,3 @@ def generate_launch_description():
return LaunchDescription(
declared_arguments + [OpaqueFunction(function=launch_setup)]
)

Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,3 @@ pick_place_task_demo:
type: double
lift_object_max_dist:
type: double

Loading

0 comments on commit ce19cc1

Please sign in to comment.