├── max_min_lp_simulation
├── data
│ ├── greedy
│ │ ├── robots_0.txt
│ │ ├── robots_1.txt
│ │ ├── robots_2.txt
│ │ ├── robots_3.txt
│ │ ├── robots_4.txt
│ │ ├── robots_5.txt
│ │ ├── results.txt
│ │ └── results_for_debug.txt
│ └── local
│ │ ├── robots_2.txt
│ │ ├── robots_4.txt
│ │ ├── results.txt
│ │ ├── robots_1.txt
│ │ ├── robots_3.txt
│ │ ├── robots_5.txt
│ │ └── targets.txt
├── srv
│ ├── GetTotalNumTarget.srv
│ ├── GetOdom.srv
│ ├── MotionPrimitiveRequest.srv
│ ├── MoveRobot.srv
│ └── MessageRequest.srv
├── urdf
│ ├── box.urdf.xacro
│ ├── box_library.urdf.xacro
│ └── kobuki.urdf.xacro
├── package.xml
├── include
│ └── max_min_lp_simulation
│ │ ├── get_odom.hpp
│ │ ├── apply_motion_primitive.hpp
│ │ ├── apply_motion_primitive_journal.hpp
│ │ ├── kalman.hpp
│ │ ├── RobotGreedyJournal.hpp
│ │ ├── MaxMinLPRobotNode.hpp
│ │ ├── MaxMinLPGreedyRobotNode.hpp
│ │ ├── MaxMinLPGreedyCentralNode.hpp
│ │ ├── MaxMinLPRobotNodeSimulation.hpp
│ │ ├── MaxMinLPCentralNode.hpp
│ │ └── MaxMinLPCentralNodeSimulation.hpp
├── launch
│ ├── single_robot_case.launch
│ ├── journal.launch
│ ├── includes
│ │ ├── moving_target.launch.xml
│ │ └── kobuki.launch.xml
│ ├── greedy_robots_journal.launch
│ ├── three_robot_four_target_case_failure_case.launch
│ ├── two_robot_three_target_case.launch
│ ├── test_motion_primitive.launch
│ ├── three_robot_four_target_case.launch
│ ├── motion_primitive_test.launch
│ └── server_to_robots.launch
├── src
│ ├── kalman.cpp
│ ├── get_odom.cpp
│ ├── get_result_target_num.cpp
│ ├── apply_motion_primitive_journal.cpp
│ ├── get_target_odom_journal.cpp
│ ├── animated_box_journal.cc
│ └── apply_motion_primitive.cpp
├── gazebo_model
│ └── world
│ │ └── target_spawn_journal.world
└── CMakeLists.txt
├── max_min_lp_experiment
├── README.md
├── srv
│ ├── TargetRequest.srv
│ └── RobotRequest.srv
├── yaml
│ └── target_model.yaml
├── launch
│ └── greedy_central.launch
├── package.xml
├── CMakeLists.txt
├── include
│ └── max_min_lp_experiment
│ │ ├── TargetNode.hpp
│ │ ├── GreedyRobotNode.hpp
│ │ └── GreedyCentralNode.hpp
└── src
│ ├── TargetNode.cpp
│ ├── GreedyRobotNode.cpp
│ └── GreedyCentralNode.cpp
├── .gitignore
├── CMakeLists.txt
├── max_min_lp_msgs
├── msg
│ ├── general_node_array.msg
│ ├── layered_node_array.msg
│ ├── server_to_robots_array.msg
│ ├── primitive_node.msg
│ ├── target_node.msg
│ ├── general_node.msg
│ ├── server_to_robots.msg
│ └── layered_node.msg
├── package.xml
└── CMakeLists.txt
├── max_min_lp
├── CMakeLists.txt
└── package.xml
├── max_min_lp_visualization
├── log
│ ├── general_graph.png
│ ├── layered_graph.png
│ └── general_graph.dot
├── package.xml
└── CMakeLists.txt
├── max_min_lp_core
├── package.xml
├── CMakeLists.txt
└── include
│ └── max_min_lp_core
│ ├── MaxMinLPCore.hpp
│ ├── MaxMinLPSequentialCore.hpp
│ └── MaxMinLPDecentralizedCore.hpp
├── max_min_lp_demo
├── package.xml
├── yaml
│ ├── test_example_2.yaml
│ ├── test_example.yaml
│ ├── test_paper_example.yaml
│ ├── test_example_num_targets.yaml
│ └── test_example_3.yaml
├── include
│ └── max_min_lp_demo
│ │ └── MaxMinLPDemo.hpp
└── CMakeLists.txt
└── README.md
/max_min_lp_simulation/data/greedy/robots_0.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/greedy/robots_1.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/greedy/robots_2.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/greedy/robots_3.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/greedy/robots_4.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/greedy/robots_5.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/greedy/results.txt:
--------------------------------------------------------------------------------
1 | 0
2 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/greedy/results_for_debug.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/max_min_lp_experiment/README.md:
--------------------------------------------------------------------------------
1 | This package is not available.
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | max_min_lp_demo/output/
2 | max_min_lp_demo/data/
3 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | /opt/ros/kinetic/share/catkin/cmake/toplevel.cmake
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/local/robots_2.txt:
--------------------------------------------------------------------------------
1 | 2 5
2 | 2 5
3 | 2 5
4 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/local/robots_4.txt:
--------------------------------------------------------------------------------
1 | 4 -1
2 | 4 -1
3 | 4 -1
4 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/local/results.txt:
--------------------------------------------------------------------------------
1 | 3.610000000 23
2 | 6.501000000 24
3 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/local/robots_1.txt:
--------------------------------------------------------------------------------
1 | -1 4
2 | -1.9 3.8
3 | -1.9 3.8
4 |
--------------------------------------------------------------------------------
/max_min_lp_msgs/msg/general_node_array.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | general_node[] gen_nodes
--------------------------------------------------------------------------------
/max_min_lp_msgs/msg/layered_node_array.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | layered_node[] lay_nodes
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/local/robots_3.txt:
--------------------------------------------------------------------------------
1 | 0 0
2 | 0 -2.8e-06
3 | 0.33 -0.52
4 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/local/robots_5.txt:
--------------------------------------------------------------------------------
1 | -4 -2
2 | -3.1 -2.3
3 | -3.1 -2.3
4 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/srv/GetTotalNumTarget.srv:
--------------------------------------------------------------------------------
1 | string request_odom
2 |
3 | ---
4 |
5 | int8 total_num_target
--------------------------------------------------------------------------------
/max_min_lp_msgs/msg/server_to_robots_array.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | server_to_robots[] each_robot
3 | string[] robot_status
--------------------------------------------------------------------------------
/max_min_lp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(max_min_lp)
3 | find_package(catkin REQUIRED)
4 | catkin_metapackage()
--------------------------------------------------------------------------------
/max_min_lp_simulation/srv/GetOdom.srv:
--------------------------------------------------------------------------------
1 | string request_odom
2 |
3 | ---
4 |
5 | geometry_msgs/Pose return_odom
6 | geometry_msgs/Pose[] return_target_odom
--------------------------------------------------------------------------------
/max_min_lp_visualization/log/general_graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raaslab/multi-robot_task_allocation/HEAD/max_min_lp_visualization/log/general_graph.png
--------------------------------------------------------------------------------
/max_min_lp_visualization/log/layered_graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raaslab/multi-robot_task_allocation/HEAD/max_min_lp_visualization/log/layered_graph.png
--------------------------------------------------------------------------------
/max_min_lp_msgs/msg/primitive_node.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | int16[] neighbor_primitive_id
3 | float64[] neighbor_p_x_pos
4 | float64[] neighbor_p_y_pos
5 | float64[] neighbor_p_t_weight
--------------------------------------------------------------------------------
/max_min_lp_simulation/srv/MotionPrimitiveRequest.srv:
--------------------------------------------------------------------------------
1 | int8 request_ROBOT_id
2 | int8 count_motion_primitive
3 |
4 | ---
5 |
6 | int8 return_count_motion_primitive
7 | int8 selected_primitive_id
--------------------------------------------------------------------------------
/max_min_lp_experiment/srv/TargetRequest.srv:
--------------------------------------------------------------------------------
1 | string state_request
2 |
3 | ---
4 |
5 | string state_answer
6 |
7 | # Target info
8 | int8[] target_id
9 | geometry_msgs/Point[] target_pose
10 |
--------------------------------------------------------------------------------
/max_min_lp_msgs/msg/target_node.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | int16[] target_id
3 | float64[] t_x_pos
4 | float64[] t_y_pos
5 | float64[] t_p_weight
6 | bool[] neighbor_primitive_exist
7 |
8 | primitive_node[] connect_primitive
--------------------------------------------------------------------------------
/max_min_lp_msgs/msg/general_node.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | string type
3 | int16 id
4 | int16 loc_deg
5 | int16[] loc_neighbor
6 | float64[] loc_edge_weight
7 | float64 x_pos
8 | float64 y_pos
9 | float32 z_v # Used in the phase 4
--------------------------------------------------------------------------------
/max_min_lp_experiment/yaml/target_model.yaml:
--------------------------------------------------------------------------------
1 | num_of_targets: 1
2 |
3 | target_id: [0] # ID starts with 0.
4 |
5 | pose_x: [2] # In meters.
6 | pose_y: [0]
7 |
8 | velocity: [0.1] # In meters/second.
9 | orientation: [30] # In degree.
--------------------------------------------------------------------------------
/max_min_lp_simulation/srv/MoveRobot.srv:
--------------------------------------------------------------------------------
1 | geometry_msgs/Pose goal_pos
2 | int8 rotation_direction
3 | int8 trans_duration
4 | int8 ang_duration
5 | float64 trans_speed
6 | float64 ang_speed
7 |
8 | ---
9 |
10 | string answer_msg
--------------------------------------------------------------------------------
/max_min_lp_msgs/msg/server_to_robots.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | int16 robot_id
3 | float64 r_x_pos
4 | float64 r_y_pos
5 |
6 | int16[] primitive_id
7 | float64[] p_x_pos
8 | float64[] p_y_pos
9 | float64[] p_r_weight
10 | bool[] target_exist
11 |
12 | target_node[] connect_target
--------------------------------------------------------------------------------
/max_min_lp_experiment/srv/RobotRequest.srv:
--------------------------------------------------------------------------------
1 | string state_request
2 | int8 robot_id
3 | geometry_msgs/Point robot_pose
4 |
5 | ---
6 |
7 | string state_answer
8 |
9 | # Target info
10 | int8[] target_id
11 | geometry_msgs/Point[] target_pose
12 |
13 | # Communicative last robot info
14 | int8 comm_robot_id
--------------------------------------------------------------------------------
/max_min_lp_simulation/data/local/targets.txt:
--------------------------------------------------------------------------------
1 | -3 6 5 5 4 -3 6 1 -3 1 -1 -3 0 2 1 -2 -5 -3 1 7 -4 -4 -1 -4 -1 -1 6 -2 4 2 2 3 0 8.1 2 -3 -5 3 1 -5 3 6 -4 0 1 0 -1 2 -4 5 6 0 -5 1 -1 6 1 -3 8 1
2 | -3 6 5 5 4 -3 6 1 -3 1 -1 -3 0 2 1 -2 -5.1 -3.1 1 7 -4 -4 -1 -4 -1 -1 6.1 -1.9 4 2 2 3 0 8.1 2 -3 -5 3 1 -5 3 6 -4 0 1 0 -1.1 2 -4 5 6 0 -5 1 -1 6 1 -3 8 1
3 |
--------------------------------------------------------------------------------
/max_min_lp_core/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | max_min_lp_core
4 | 0.0.0
5 | The max_min_lp_core package
6 | Yoonchang Sung
7 | TODO
8 |
9 | catkin
10 | max_min_lp_msgs
11 | max_min_lp_msgs
12 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/urdf/box.urdf.xacro:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/max_min_lp_experiment/launch/greedy_central.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/max_min_lp_msgs/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | max_min_lp_msgs
4 | 0.0.0
5 | The max_min_lp_msgs package
6 | Yoonchang Sung
7 | TODO
8 |
9 | catkin
10 | roscpp
11 | message_generation
12 | std_msgs
13 | geometry_msgs
14 | message_runtime
15 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/urdf/box_library.urdf.xacro:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/max_min_lp_core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(max_min_lp_core)
3 |
4 | find_package(catkin REQUIRED COMPONENTS
5 | max_min_lp_msgs
6 | )
7 |
8 | catkin_package(
9 | INCLUDE_DIRS include
10 | LIBRARIES max_min_lp_core
11 | CATKIN_DEPENDS max_min_lp_msgs
12 | DEPENDS
13 | )
14 |
15 | include_directories(
16 | include
17 | ${catkin_INCLUDE_DIRS}
18 | )
19 |
20 | add_library(${PROJECT_NAME}
21 | src/MaxMinLPCore.cpp
22 | src/MaxMinLPDecentralizedCore.cpp
23 | src/MaxMinLPSequentialCore.cpp
24 | )
25 |
26 | target_link_libraries(${PROJECT_NAME}
27 | ${catkin_LIBRARIES}
28 | )
29 |
30 | add_dependencies(${PROJECT_NAME} max_min_lp_msgs_generate_messages_cpp)
31 |
--------------------------------------------------------------------------------
/max_min_lp/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | max_min_lp
4 | 0.0.0
5 | The max_min_lp package
6 | Yoonchang Sung
7 | TODO
8 | catkin
9 | max_min_lp_core
10 | max_min_lp_msgs
11 | max_min_lp_demo
12 | max_min_lp_simulation
13 | max_min_lp_experiment
14 | max_min_lp_visualization
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/max_min_lp_msgs/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(max_min_lp_msgs)
3 |
4 | find_package(catkin REQUIRED COMPONENTS
5 | roscpp
6 | std_msgs
7 | message_generation
8 | )
9 |
10 | add_message_files(
11 | DIRECTORY msg
12 | FILES
13 | general_node.msg
14 | general_node_array.msg
15 | layered_node.msg
16 | layered_node_array.msg
17 | target_node.msg
18 | primitive_node.msg
19 | server_to_robots.msg
20 | server_to_robots_array.msg
21 | )
22 |
23 | generate_messages(
24 | DEPENDENCIES
25 | std_msgs
26 | )
27 |
28 | catkin_package(
29 | # INCLUDE_DIRS include
30 | # LIBRARIES
31 | CATKIN_DEPENDS roscpp std_msgs message_runtime
32 | # DEPENDS system_lib
33 | )
34 | include_directories(
35 | ${catkin_INCLUDE_DIRS}
36 | )
--------------------------------------------------------------------------------
/max_min_lp_experiment/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | max_min_lp_experiment
4 | 0.0.0
5 | The max_min_lp_experiment package
6 | Yoonchang Sung
7 | TODO
8 |
9 | catkin
10 | roscpp
11 | rospy
12 | std_msgs
13 | tf
14 | message_generation
15 | roscpp
16 | rospy
17 | std_msgs
18 | tf
19 | message_runtime
20 |
--------------------------------------------------------------------------------
/max_min_lp_demo/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | max_min_lp_demo
4 | 0.0.0
5 | The local algorithm-based max min linear programs for the target allocation
6 | Yoonchang Sung
7 | TODO
8 |
9 | catkin
10 | roscpp
11 | std_msgs
12 | max_min_lp_msgs
13 | max_min_lp_core
14 | roscpp
15 | std_msgs
16 | max_min_lp_msgs
17 | max_min_lp_core
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/max_min_lp_msgs/msg/layered_node.msg:
--------------------------------------------------------------------------------
1 | Header header
2 | int16 id
3 | int16 layer
4 | int16 connected_id
5 | string state
6 | bool red_tree_candidate
7 |
8 | float32 x_v # For red and blue nodes
9 | float32 f_r # For robot nodes
10 | float32 g_t # For target nodes
11 | float32 t_r # For red nodes in the first layer (S*(r))
12 |
13 | float32 z_r # For red nodes in the recursive algorithm
14 | float32 z_b # For blue nodes in the recursive algorithm
15 | float32 s_b # For blue nodes in the phase 3 of the recursive algorithm
16 | float32 z_v # For red and blue nodes in the last of the phase 3
17 |
18 | float64[] edge_weight
19 |
20 | int16 loc_deg # Number of degress on the corresponding node
21 | int16[] loc_neighbor_id # ID of local neighbors
22 | int16[] loc_layer # Layer for the local neighbors
23 | int16[] loc_connected_id
24 | string[] loc_state
--------------------------------------------------------------------------------
/max_min_lp_simulation/srv/MessageRequest.srv:
--------------------------------------------------------------------------------
1 | string state_check
2 | int8 robot_id
3 | geometry_msgs/Pose robot_info
4 | geometry_msgs/Pose[] motion_primitive_info
5 |
6 | ---
7 |
8 | string state_answer
9 | max_min_lp_msgs/server_to_robots neighbor_info
10 | max_min_lp_msgs/general_node[] gen_r_node
11 | max_min_lp_msgs/general_node[] gen_p_r_node
12 | max_min_lp_msgs/general_node[] gen_p_t_node
13 | max_min_lp_msgs/general_node[] gen_t_node
14 |
15 | int8 max_neighbor_hop
16 | int8 num_neighbors_at_each_hop
17 | int8 num_new_targets_at_each_hop
18 |
19 | ## ROBOT info
20 | # ROBOT to robot
21 | int8[] ROBOT_num_robot
22 | int8[] prev_accumulate_robot
23 | int8 num_survived_robot
24 |
25 | # ROBOT to motion primitive
26 | int8[] ROBOT_num_motion_primitive
27 | int8[] prev_accumulate_motion_primitive
28 | int8 num_survived_motion_primitive
29 |
30 | float64[] constraint_value
--------------------------------------------------------------------------------
/max_min_lp_simulation/package.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | max_min_lp_simulation
4 | 0.0.0
5 | The max_min_lp_simulate package
6 | Yoonchang Sung
7 | TODO
8 |
9 | catkin
10 | roscpp
11 | std_msgs
12 | max_min_lp_msgs
13 | max_min_lp_core
14 | message_generation
15 | tf
16 | gazebo_msgs
17 | eigen
18 | roscpp
19 | std_msgs
20 | max_min_lp_msgs
21 | max_min_lp_core
22 | message_runtime
23 | tf
24 | gazebo_msgs
25 | eigen
26 |
--------------------------------------------------------------------------------
/max_min_lp_demo/yaml/test_example_2.yaml:
--------------------------------------------------------------------------------
1 | #Setting for the global graph
2 | num_r: 2
3 | num_p: 4
4 | num_t: 2
5 |
6 | #Setting for the robot nodes
7 | r1_deg: 2
8 | r1_neighbor: [1, 2]
9 | r1_edge_weight: [1, 1]
10 | r2_deg: 2
11 | r2_neighbor: [3, 4]
12 | r2_edge_weight: [1, 1]
13 |
14 | #Setting for the motion primitives to robot nodes
15 | p1_r_deg: 1
16 | p1_r_neighbor: [1]
17 | p1_r_edge_weight: [1]
18 | p2_r_deg: 1
19 | p2_r_neighbor: [1]
20 | p2_r_edge_weight: [1]
21 | p3_r_deg: 1
22 | p3_r_neighbor: [2]
23 | p3_r_edge_weight: [1]
24 | p4_r_deg: 1
25 | p4_r_neighbor: [2]
26 | p4_r_edge_weight: [1]
27 |
28 | #Setting for the motion primitives to target nodes
29 | p1_t_deg: 1
30 | p1_t_neighbor: [1]
31 | p1_t_edge_weight: [5]
32 | p2_t_deg: 2
33 | p2_t_neighbor: [1, 2]
34 | p2_t_edge_weight: [1, 7]
35 | p3_t_deg: 1
36 | p3_t_neighbor: [1]
37 | p3_t_edge_weight: [6]
38 | p4_t_deg: 1
39 | p4_t_neighbor: [2]
40 | p4_t_edge_weight: [1]
41 |
42 | #Setting for the targets nodes
43 | t1_deg: 3
44 | t1_neighbor: [1, 2, 3]
45 | t1_edge_weight: [5, 1, 6]
46 | t2_deg: 2
47 | t2_neighbor: [2, 4]
48 | t2_edge_weight: [7, 1]
--------------------------------------------------------------------------------
/max_min_lp_experiment/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 2.8.3)
2 | project(max_min_lp_experiment)
3 |
4 | SET(CMAKE_CXX_FLAGS "-std=c++0x")
5 |
6 | find_package(catkin REQUIRED COMPONENTS
7 | roscpp
8 | rospy
9 | std_msgs
10 | tf
11 | genmsg
12 | )
13 |
14 | add_service_files(
15 | FILES
16 | RobotRequest.srv
17 | TargetRequest.srv
18 | )
19 |
20 | generate_messages(
21 | DEPENDENCIES
22 | std_msgs
23 | geometry_msgs
24 | )
25 |
26 | catkin_package(
27 | INCLUDE_DIRS include
28 | LIBRARIES max_min_lp_experiment
29 | CATKIN_DEPENDS roscpp rospy std_msgs tf message_runtime
30 | # DEPENDS system_lib
31 | )
32 |
33 | include_directories(
34 | include
35 | ${catkin_INCLUDE_DIRS}
36 | )
37 |
38 | add_executable(central_node src/GreedyCentralNode.cpp)
39 | target_link_libraries(central_node
40 | ${catkin_LIBRARIES}
41 | )
42 |
43 | add_executable(robot_node src/GreedyRobotNode.cpp)
44 | target_link_libraries(robot_node
45 | ${catkin_LIBRARIES}
46 | )
47 |
48 | add_executable(target_node src/TargetNode.cpp)
49 | target_link_libraries(target_node
50 | ${catkin_LIBRARIES}
51 | )
52 |
--------------------------------------------------------------------------------
/max_min_lp_experiment/include/max_min_lp_experiment/TargetNode.hpp:
--------------------------------------------------------------------------------
1 | #ifndef TARGETNODE_HPP_
2 | #define TARGETNODE_HPP_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 |
16 | using namespace std;
17 |
18 | class TargetNode {
19 | private:
20 | ros::NodeHandle m_nh;
21 | ros::NodeHandle m_private_nh;
22 |
23 | // Services
24 | ros::ServiceServer m_request_service;
25 |
26 | // Params from the launch file
27 | int m_time_period;
28 |
29 | // Target information
30 | int m_num_target;
31 | vector m_target_id;
32 | vector m_target_pose_x;
33 | vector m_target_pose_y;
34 | vector m_target_velocity;
35 | vector m_target_orientation;
36 | int m_time_step;
37 |
38 | public:
39 | TargetNode(); // Constructor
40 |
41 | bool applyTargetMotion(max_min_lp_experiment::TargetRequest::Request &req, max_min_lp_experiment::TargetRequest::Response &res);
42 | void targetInitialize();
43 | };
44 |
45 | #endif
--------------------------------------------------------------------------------
/max_min_lp_simulation/include/max_min_lp_simulation/get_odom.hpp:
--------------------------------------------------------------------------------
1 | #ifndef GETODOM_HPP_
2 | #define GETODOM_HPP_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 |
18 | using namespace std;
19 |
20 | class get_odom {
21 | private:
22 | ros::NodeHandle m_nh;
23 | ros::NodeHandle m_private_nh;
24 |
25 | // Subscribers
26 | ros::Subscriber m_odom_sub;
27 |
28 | // Publishers
29 | ros::Publisher m_general_node_pub;
30 |
31 | // Services
32 | ros::ServiceServer m_odom_service;
33 |
34 | string m_robot_name;
35 | int m_num_robot;
36 | int m_num_target;
37 | int m_robot_id;
38 |
39 | geometry_msgs::Pose m_pos;
40 |
41 | public:
42 | get_odom(); // Constructor
43 |
44 | void updateOdom(const gazebo_msgs::ModelStates::ConstPtr& msg); // Update odometry information by subscribing to /robot/odom
45 | bool return_odom(max_min_lp_simulation::GetOdom::Request &req, max_min_lp_simulation::GetOdom::Response &res);
46 | };
47 |
48 | #endif
--------------------------------------------------------------------------------
/max_min_lp_simulation/launch/single_robot_case.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/launch/journal.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/max_min_lp_demo/yaml/test_example.yaml:
--------------------------------------------------------------------------------
1 | #Setting for the global graph
2 | num_r: 3
3 | num_p: 6
4 | num_t: 3
5 |
6 | #Setting for the robot nodes
7 | r1_deg: 2
8 | r1_neighbor: [1, 2]
9 | r1_edge_weight: [1, 1]
10 | r2_deg: 2
11 | r2_neighbor: [3, 4]
12 | r2_edge_weight: [1, 1]
13 | r3_deg: 2
14 | r3_neighbor: [5, 6]
15 | r3_edge_weight: [1, 1]
16 |
17 | #Setting for the motion primitives to robot nodes
18 | p1_r_deg: 1
19 | p1_r_neighbor: [1]
20 | p1_r_edge_weight: [1]
21 | p2_r_deg: 1
22 | p2_r_neighbor: [1]
23 | p2_r_edge_weight: [1]
24 | p3_r_deg: 1
25 | p3_r_neighbor: [2]
26 | p3_r_edge_weight: [1]
27 | p4_r_deg: 1
28 | p4_r_neighbor: [2]
29 | p4_r_edge_weight: [1]
30 | p5_r_deg: 1
31 | p5_r_neighbor: [3]
32 | p5_r_edge_weight: [1]
33 | p6_r_deg: 1
34 | p6_r_neighbor: [3]
35 | p6_r_edge_weight: [1]
36 |
37 | #Setting for the motion primitives to target nodes
38 | p1_t_deg: 1
39 | p1_t_neighbor: [1]
40 | p1_t_edge_weight: [5]
41 | p2_t_deg: 1
42 | p2_t_neighbor: [2]
43 | p2_t_edge_weight: [3]
44 | p3_t_deg: 2
45 | p3_t_neighbor: [2, 3]
46 | p3_t_edge_weight: [3, 3]
47 | p4_t_deg: 1
48 | p4_t_neighbor: [3]
49 | p4_t_edge_weight: [4]
50 | p5_t_deg: 1
51 | p5_t_neighbor: [3]
52 | p5_t_edge_weight: [2]
53 | p6_t_deg: 1
54 | p6_t_neighbor: [1]
55 | p6_t_edge_weight: [4]
56 |
57 | #Setting for the targets nodes
58 | t1_deg: 2
59 | t1_neighbor: [1, 6]
60 | t1_edge_weight: [5, 4]
61 | t2_deg: 2
62 | t2_neighbor: [2, 3]
63 | t2_edge_weight: [3, 3]
64 | t3_deg: 3
65 | t3_neighbor: [3, 4, 5]
66 | t3_edge_weight: [3, 4, 2]
--------------------------------------------------------------------------------
/max_min_lp_demo/yaml/test_paper_example.yaml:
--------------------------------------------------------------------------------
1 | #Setting for the global graph
2 | num_r: 3
3 | num_p: 6
4 | num_t: 3
5 |
6 | #Setting for the robot nodes
7 | r1_deg: 2
8 | r1_neighbor: [1, 2]
9 | r1_edge_weight: [5, 4]
10 | r2_deg: 2
11 | r2_neighbor: [3, 4]
12 | r2_edge_weight: [3, 4]
13 | r3_deg: 2
14 | r3_neighbor: [5, 6]
15 | r3_edge_weight: [4, 5]
16 |
17 | #Setting for the motion primitives to robot nodes
18 | p1_r_deg: 1
19 | p1_r_neighbor: [1]
20 | p1_r_edge_weight: [5]
21 | p2_r_deg: 1
22 | p2_r_neighbor: [1]
23 | p2_r_edge_weight: [4]
24 | p3_r_deg: 1
25 | p3_r_neighbor: [2]
26 | p3_r_edge_weight: [3]
27 | p4_r_deg: 1
28 | p4_r_neighbor: [2]
29 | p4_r_edge_weight: [4]
30 | p5_r_deg: 1
31 | p5_r_neighbor: [3]
32 | p5_r_edge_weight: [4]
33 | p6_r_deg: 1
34 | p6_r_neighbor: [3]
35 | p6_r_edge_weight: [5]
36 |
37 | #Setting for the motion primitives to target nodes
38 | p1_t_deg: 1
39 | p1_t_neighbor: [1]
40 | p1_t_edge_weight: [4]
41 | p2_t_deg: 1
42 | p2_t_neighbor: [2]
43 | p2_t_edge_weight: [5]
44 | p3_t_deg: 1
45 | p3_t_neighbor: [1]
46 | p3_t_edge_weight: [5]
47 | p4_t_deg: 1
48 | p4_t_neighbor: [2]
49 | p4_t_edge_weight: [3]
50 | p5_t_deg: 2
51 | p5_t_neighbor: [2, 3]
52 | p5_t_edge_weight: [5, 4]
53 | p6_t_deg: 1
54 | p6_t_neighbor: [3]
55 | p6_t_edge_weight: [3]
56 |
57 | #Setting for the targets nodes
58 | t1_deg: 2
59 | t1_neighbor: [1, 3]
60 | t1_edge_weight: [4, 5]
61 | t2_deg: 3
62 | t2_neighbor: [2, 4, 5]
63 | t2_edge_weight: [5, 3, 5]
64 | t3_deg: 2
65 | t3_neighbor: [5, 6]
66 | t3_edge_weight: [4, 3]
--------------------------------------------------------------------------------
/max_min_lp_simulation/include/max_min_lp_simulation/apply_motion_primitive.hpp:
--------------------------------------------------------------------------------
1 | #ifndef APPLYMOTIONPRIMITIVE_HPP_
2 | #define APPLYMOTIONPRIMITIVE_HPP_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | using namespace std;
22 |
23 | class apply_motion_primitive {
24 | private:
25 | ros::NodeHandle m_nh;
26 | ros::NodeHandle m_private_nh;
27 |
28 | // Subscribers
29 | ros::Subscriber m_odom_sub;
30 |
31 | // Publishers
32 | ros::Publisher m_cmd_vel_robot_pub;
33 |
34 | // Services
35 | ros::ServiceServer m_move_service;
36 |
37 | // Clients
38 | ros::ServiceClient m_odom_client;
39 |
40 | string m_robot_name;
41 | int m_num_robot;
42 | int m_num_target;
43 | int m_robot_id;
44 | int m_check_rotation_direction;
45 | geometry_msgs::Pose m_goal_pos;
46 |
47 | geometry_msgs::Pose m_pos;
48 |
49 | public:
50 | apply_motion_primitive(); // Constructor
51 |
52 | bool move_robot(max_min_lp_simulation::MoveRobot::Request &req, max_min_lp_simulation::MoveRobot::Response &res);
53 | };
54 |
55 | #endif
--------------------------------------------------------------------------------
/max_min_lp_visualization/log/general_graph.dot:
--------------------------------------------------------------------------------
1 | strict graph {
2 | graph [bb="0,0,0,0"];
3 | node [label="\N"];
4 | robot1 [pos="-375.000000,75.000000)"];
5 | primitive1 [pos="-225.000000,0.000000)"];
6 | robot1 -- primitive1 [label=2.0,
7 | weight=2.0];
8 | primitive2 [pos="-75.000000,0.000000)"];
9 | robot1 -- primitive2 [label=2.0,
10 | weight=2.0];
11 | robot2 [pos="-225.000000,75.000000)"];
12 | robot2 -- primitive1 [label=2.0,
13 | weight=2.0];
14 | primitive3 [pos="75.000000,0.000000)"];
15 | robot2 -- primitive3 [label=2.0,
16 | weight=2.0];
17 | robot3 [pos="-75.000000,75.000000)"];
18 | robot3 -- primitive1 [label=2.0,
19 | weight=2.0];
20 | primitive4 [pos="225.000000,0.000000)"];
21 | robot3 -- primitive4 [label=2.0,
22 | weight=2.0];
23 | robot4 [pos="75.000000,75.000000)"];
24 | robot4 -- primitive2 [label=2.0,
25 | weight=2.0];
26 | robot4 -- primitive3 [label=2.0,
27 | weight=2.0];
28 | robot5 [pos="225.000000,75.000000)"];
29 | robot5 -- primitive2 [label=2.0,
30 | weight=2.0];
31 | robot5 -- primitive4 [label=2.0,
32 | weight=2.0];
33 | robot6 [pos="375.000000,75.000000)"];
34 | robot6 -- primitive3 [label=2.0,
35 | weight=2.0];
36 | robot6 -- primitive4 [label=2.0,
37 | weight=2.0];
38 | target1 [pos="0.000000,-75.000000)"];
39 | target1 -- primitive1 [label=1.0,
40 | weight=1.0];
41 | target1 -- primitive2 [label=1.0,
42 | weight=1.0];
43 | target1 -- primitive3 [label=1.0,
44 | weight=1.0];
45 | target1 -- primitive4 [label=1.0,
46 | weight=1.0];
47 | }
48 |
--------------------------------------------------------------------------------
/max_min_lp_simulation/include/max_min_lp_simulation/apply_motion_primitive_journal.hpp:
--------------------------------------------------------------------------------
1 | #ifndef APPLYMOTIONPRIMITIVEJOURNAL_HPP_
2 | #define APPLYMOTIONPRIMITIVEJOURNAL_HPP_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 |
21 | using namespace std;
22 |
23 | class apply_motion_primitive {
24 | private:
25 | ros::NodeHandle m_nh;
26 | ros::NodeHandle m_private_nh;
27 |
28 | // Subscribers
29 | ros::Subscriber m_odom_sub;
30 |
31 | // Publishers
32 | ros::Publisher m_cmd_vel_robot_pub;
33 |
34 | // Services
35 | ros::ServiceServer m_move_service;
36 |
37 | // Clients
38 | ros::ServiceClient m_odom_client;
39 |
40 | string m_robot_name;
41 | int m_num_robot;
42 | int m_num_target;
43 | int m_robot_id;
44 | int m_check_rotation_direction;
45 | int m_trans_duration;
46 | int m_ang_duration;
47 | double m_trans_speed;
48 | double m_ang_speed;
49 |
50 | geometry_msgs::Pose m_pos;
51 |
52 | public:
53 | apply_motion_primitive(); // Constructor
54 |
55 | bool move_robot(max_min_lp_simulation::MoveRobot::Request &req, max_min_lp_simulation::MoveRobot::Response &res);
56 | };
57 |
58 | #endif
--------------------------------------------------------------------------------
/max_min_lp_demo/yaml/test_example_num_targets.yaml:
--------------------------------------------------------------------------------
1 | #Setting for the global graph
2 | input_path: '/home/yoon/yoon/max_min_ws/src/max_min_lp_demo/data/t100/t100d8/30_100_8/'
3 | output_path: '/home/yoon/yoon/max_min_ws/src/max_min_lp_demo/outputs/t100/t100d8/30_100_8/'
4 |
5 | num_r: 3
6 | num_p: 6
7 | num_t: 3
8 |
9 | #Setting for the robot nodes
10 | r1_deg: 2
11 | r1_neighbor: [1, 2]
12 | r1_edge_weight: [1, 1]
13 | r2_deg: 2
14 | r2_neighbor: [3, 4]
15 | r2_edge_weight: [1, 1]
16 | r3_deg: 2
17 | r3_neighbor: [5, 6]
18 | r3_edge_weight: [1, 1]
19 |
20 | #Setting for the motion primitives to robot nodes
21 | p1_r_deg: 1
22 | p1_r_neighbor: [1]
23 | p1_r_edge_weight: [1]
24 | p2_r_deg: 1
25 | p2_r_neighbor: [1]
26 | p2_r_edge_weight: [1]
27 | p3_r_deg: 1
28 | p3_r_neighbor: [2]
29 | p3_r_edge_weight: [1]
30 | p4_r_deg: 1
31 | p4_r_neighbor: [2]
32 | p4_r_edge_weight: [1]
33 | p5_r_deg: 1
34 | p5_r_neighbor: [3]
35 | p5_r_edge_weight: [1]
36 | p6_r_deg: 1
37 | p6_r_neighbor: [3]
38 | p6_r_edge_weight: [1]
39 |
40 | #Setting for the motion primitives to target nodes
41 | p1_t_deg: 1
42 | p1_t_neighbor: [1]
43 | p1_t_edge_weight: [1]
44 | p2_t_deg: 1
45 | p2_t_neighbor: [2]
46 | p2_t_edge_weight: [1]
47 | p3_t_deg: 2
48 | p3_t_neighbor: [2, 3]
49 | p3_t_edge_weight: [1, 1]
50 | p4_t_deg: 1
51 | p4_t_neighbor: [3]
52 | p4_t_edge_weight: [1]
53 | p5_t_deg: 1
54 | p5_t_neighbor: [3]
55 | p5_t_edge_weight: [1]
56 | p6_t_deg: 1
57 | p6_t_neighbor: [1]
58 | p6_t_edge_weight: [1]
59 |
60 | #Setting for the targets nodes
61 | t1_deg: 2
62 | t1_neighbor: [1, 6]
63 | t1_edge_weight: [1, 1]
64 | t2_deg: 2
65 | t2_neighbor: [2, 3]
66 | t2_edge_weight: [1, 1]
67 | t3_deg: 3
68 | t3_neighbor: [3, 4, 5]
69 | t3_edge_weight: [1, 1, 1]
--------------------------------------------------------------------------------
/max_min_lp_simulation/src/kalman.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Implementation of KalmanFilter class.
3 | *
4 | * @author: Hayk Martirosyan
5 | * @date: 2014.11.15
6 | */
7 |
8 | #include
9 | #include
10 |
11 | #include "max_min_lp_simulation/kalman.hpp"
12 |
13 | KalmanFilter::KalmanFilter(
14 | double dt,
15 | const Eigen::MatrixXd& A,
16 | const Eigen::MatrixXd& C,
17 | const Eigen::MatrixXd& B,
18 | const Eigen::MatrixXd& Q,
19 | const Eigen::MatrixXd& R,
20 | const Eigen::MatrixXd& P)
21 | : A(A), C(C), B(B), Q(Q), R(R), P0(P),
22 | m(C.rows()), n(A.rows()), dt(dt), initialized(false),
23 | I(n, n), x_hat(n), x_hat_new(n)
24 | {
25 | I.setIdentity();
26 | }
27 |
28 | KalmanFilter::KalmanFilter() {}
29 |
30 | void KalmanFilter::init(double t0, const Eigen::VectorXd& x0) {
31 | x_hat = x0;
32 | P = P0;
33 | this->t0 = t0;
34 | t = t0;
35 | initialized = true;
36 | }
37 |
38 | void KalmanFilter::init() {
39 | x_hat.setZero();
40 | P = P0;
41 | t0 = 0;
42 | t = t0;
43 | initialized = true;
44 | }
45 |
46 | void KalmanFilter::update(const Eigen::VectorXd& y, const Eigen::VectorXd& u) {
47 |
48 | if(!initialized)
49 | throw std::runtime_error("Filter is not initialized!");
50 |
51 | // std::cout<<"x_hat = "<
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include
14 | #include
15 | #include
16 | #include
17 | #include
18 | #include
19 |
20 | using namespace std;
21 |
22 | class GreedyRobotNode {
23 | private:
24 | ros::NodeHandle m_nh;
25 | ros::NodeHandle m_private_nh;
26 |
27 | // Publisher
28 | ros::Publisher m_after_motion_pub;
29 | ros::Publisher m_cmd_vel_pub;
30 | // Subscriber
31 | ros::Subscriber m_response_sub;
32 | ros::Subscriber m_pose_sub;
33 | // Clients
34 | ros::ServiceClient m_request_client;
35 |
36 | // Variables from the launch file
37 | int m_num_target;
38 | int m_robot_id;
39 | int m_num_motion_primitive;
40 | int m_time_period;
41 | double m_robot_velocity;
42 | double m_robot_angular_vel;
43 |
44 | // Robot info
45 | geometry_msgs::Point m_robot_pose;
46 |
47 | int m_count_robotInitialize_activate;
48 |
49 | // Optimal motion primitive that is applied at the end of algorithm at each time
50 | int m_selected_primitive_id;
51 | vector m_motion_case_rotation;
52 | vector m_check_rotation_direction;
53 | vector m_motion_primitive_pose;
54 |
55 | public:
56 | GreedyRobotNode(); // Constructor
57 |
58 | bool robotInitialize();
59 | vector computeMotionPrimitives();
60 | void applyMotionPrimitives(const std_msgs::String::ConstPtr& msg);
61 | void getRobotPose(const nav_msgs::Odometry::ConstPtr& msg);
62 | };
63 |
64 | #endif
--------------------------------------------------------------------------------
/max_min_lp_simulation/src/get_odom.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * Central node for the simulation
3 | * Central node only links between a set of motion primitives and a set of targets.
4 | * Important note: in this code a robot is used to take into consideration of the reduction of the step 1 of local algorithm.
5 | * Thus, a robot here does not indicate a real robot but an element of a real robot. Instead, ROBOT is used for a real robot.
6 | * \Author Yoonchang Sung
7 | * \02/27/2017
8 | * Copyright 2017. All Rights Reserved.
9 | */
10 |
11 | #include "max_min_lp_simulation/get_odom.hpp"
12 |
13 | get_odom::get_odom() :
14 | m_num_robot(1), m_num_target(1), m_robot_id(1), m_robot_name(string("robot_0")), m_private_nh("~")
15 | {
16 | m_private_nh.getParam("num_robot", m_num_robot);
17 | m_private_nh.getParam("num_target", m_num_target);
18 | m_private_nh.getParam("robot_id", m_robot_id);
19 | m_private_nh.getParam("robot_name", m_robot_name);
20 |
21 | m_odom_sub = m_nh.subscribe("/gazebo/model_states", 1000, &get_odom::updateOdom, this);
22 | m_odom_service = m_nh.advertiseService("/robot_"+boost::lexical_cast(m_robot_id)+"/odom_request", &get_odom::return_odom, this);
23 | }
24 |
25 | void get_odom::updateOdom(const gazebo_msgs::ModelStates::ConstPtr& msg) {
26 | int size_msg = m_num_robot + m_num_target + 1; // 1 is for 'ground plane' in gazebo.
27 | int id = -1;
28 | for (int i = 0; i < size_msg; i++) {
29 | if (strcmp(msg->name[i].c_str(), m_robot_name.c_str()) == 0) {
30 | id = i;
31 | }
32 | }
33 | if (id != -1) {
34 | m_pos = msg->pose[id];
35 | }
36 | }
37 |
38 | bool get_odom::return_odom(max_min_lp_simulation::GetOdom::Request &req, max_min_lp_simulation::GetOdom::Response &res) {
39 | res.return_odom = m_pos;
40 | return true;
41 | }
42 |
43 | int main(int argc, char **argv) {
44 | ros::init(argc, argv, "get_odom");
45 |
46 | get_odom gtom;
47 |
48 | ros::spin();
49 | return 0;
50 | }
--------------------------------------------------------------------------------
/max_min_lp_demo/include/max_min_lp_demo/MaxMinLPDemo.hpp:
--------------------------------------------------------------------------------
1 | #ifndef MAXMINLPDEMO_HPP_
2 | #define MAXMINLPDEMO_HPP_
3 |
4 | #include
5 | #include
6 | #include
7 | #include
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include