├── README.md ├── centralised_auction ├── CMakeLists.txt ├── README.md ├── config │ ├── rviz.rviz │ ├── rviz3.rviz │ └── rviz4.rviz ├── include │ └── centralised_auction │ │ └── sequential_auction.h ├── launch │ ├── example1.launch │ ├── example2.launch │ ├── example3.launch │ └── example4.launch ├── package.xml └── src │ ├── centralised_auction_node.cpp │ └── sequential_auction.cpp └── task_msgs ├── CMakeLists.txt ├── README.md ├── msg ├── Task.msg └── TaskArray.msg └── package.xml /README.md: -------------------------------------------------------------------------------- 1 | # task_allocation 2 | ROS package for multi robot task allocation. Given a series of task and robot locations, allocates the tasks to robots using sequential single-item auction. 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /centralised_auction/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(centralised_auction) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED COMPONENTS 11 | nav_msgs 12 | std_msgs 13 | waypoint_follower 14 | waypoint_follower_msgs 15 | multi_jackal_tutorials 16 | roscpp 17 | task_msgs 18 | ) 19 | 20 | ## System dependencies are found with CMake's conventions 21 | # find_package(Boost REQUIRED COMPONENTS system) 22 | 23 | 24 | ## Uncomment this if the package has a setup.py. This macro ensures 25 | ## modules and global scripts declared therein get installed 26 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 27 | # catkin_python_setup() 28 | 29 | ################################################ 30 | ## Declare ROS messages, services and actions ## 31 | ################################################ 32 | 33 | ## To declare and build messages, services or actions from within this 34 | ## package, follow these steps: 35 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 36 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 37 | ## * In the file package.xml: 38 | ## * add a build_depend tag for "message_generation" 39 | ## * add a build_depend and a run_depend tag for each package in MSG_DEP_SET 40 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 41 | ## but can be declared for certainty nonetheless: 42 | ## * add a run_depend tag for "message_runtime" 43 | ## * In this file (CMakeLists.txt): 44 | ## * add "message_generation" and every package in MSG_DEP_SET to 45 | ## find_package(catkin REQUIRED COMPONENTS ...) 46 | ## * add "message_runtime" and every package in MSG_DEP_SET to 47 | ## catkin_package(CATKIN_DEPENDS ...) 48 | ## * uncomment the add_*_files sections below as needed 49 | ## and list every .msg/.srv/.action file to be processed 50 | ## * uncomment the generate_messages entry below 51 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 52 | 53 | ## Generate messages in the 'msg' folder 54 | # add_message_files( 55 | # FILES 56 | # Message1.msg 57 | # Message2.msg 58 | # ) 59 | 60 | ## Generate services in the 'srv' folder 61 | # add_service_files( 62 | # FILES 63 | # Service1.srv 64 | # Service2.srv 65 | # ) 66 | 67 | ## Generate actions in the 'action' folder 68 | # add_action_files( 69 | # FILES 70 | # Action1.action 71 | # Action2.action 72 | # ) 73 | 74 | ## Generate added messages and services with any dependencies listed here 75 | # generate_messages( 76 | # DEPENDENCIES 77 | # nav_msgs# std_msgs# waypoint_follower_msgs 78 | # ) 79 | 80 | ################################################ 81 | ## Declare ROS dynamic reconfigure parameters ## 82 | ################################################ 83 | 84 | ## To declare and build dynamic reconfigure parameters within this 85 | ## package, follow these steps: 86 | ## * In the file package.xml: 87 | ## * add a build_depend and a run_depend tag for "dynamic_reconfigure" 88 | ## * In this file (CMakeLists.txt): 89 | ## * add "dynamic_reconfigure" to 90 | ## find_package(catkin REQUIRED COMPONENTS ...) 91 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 92 | ## and list every .cfg file to be processed 93 | 94 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 95 | # generate_dynamic_reconfigure_options( 96 | # cfg/DynReconf1.cfg 97 | # cfg/DynReconf2.cfg 98 | # ) 99 | 100 | ################################### 101 | ## catkin specific configuration ## 102 | ################################### 103 | ## The catkin_package macro generates cmake config files for your package 104 | ## Declare things to be passed to dependent projects 105 | ## INCLUDE_DIRS: uncomment this if your package contains header files 106 | ## LIBRARIES: libraries you create in this project that dependent projects also need 107 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 108 | ## DEPENDS: system dependencies of this project that dependent projects also need 109 | catkin_package( 110 | INCLUDE_DIRS include 111 | # LIBRARIES centralised_auction 112 | CATKIN_DEPENDS nav_msgs std_msgs waypoint_follower_msgs task_msgs 113 | # DEPENDS system_lib 114 | ) 115 | 116 | ########### 117 | ## Build ## 118 | ########### 119 | 120 | ## Specify additional locations of header files 121 | ## Your package locations should be listed before other locations 122 | include_directories( 123 | include 124 | ${catkin_INCLUDE_DIRS} 125 | ) 126 | 127 | ## Declare a C++ library 128 | #add_library(centralised_auction_node src/centralised_auction_node.cpp) 129 | add_library(sequential_auction src/sequential_auction.cpp) 130 | 131 | ## Add cmake target dependencies of the library 132 | ## as an example, code may need to be generated before libraries 133 | ## either from message generation or dynamic reconfigure 134 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 135 | 136 | ## Declare a C++ executable 137 | ## With catkin_make all packages are built within a single CMake context 138 | ## The recommended prefix ensures that target names across packages don't collide 139 | add_executable(centralised_auction_node src/centralised_auction_node.cpp src/sequential_auction.cpp) 140 | 141 | ## Rename C++ executable without prefix 142 | ## The above recommended prefix causes long target names, the following renames the 143 | ## target back to the shorter version for ease of user use 144 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 145 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 146 | 147 | ## Add cmake target dependencies of the executable 148 | ## same as for the library above 149 | add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 150 | 151 | ## Specify libraries to link a library or executable target against 152 | target_link_libraries(centralised_auction_node sequential_auction ${catkin_LIBRARIES}) 153 | 154 | ############# 155 | ## Install ## 156 | ############# 157 | 158 | # all install targets should use catkin DESTINATION variables 159 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 160 | 161 | ## Mark executable scripts (Python etc.) for installation 162 | ## in contrast to setup.py, you can choose the destination 163 | # install(PROGRAMS 164 | # scripts/my_python_script 165 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 166 | # ) 167 | 168 | ## Mark executables and/or libraries for installation 169 | install(TARGETS 170 | centralised_auction_node 171 | sequential_auction 172 | ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 173 | LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 174 | RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 175 | ) 176 | 177 | ## Mark cpp header files for installation 178 | install(DIRECTORY include/${PROJECT_NAME}/ 179 | DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 180 | FILES_MATCHING PATTERN "*.h" 181 | PATTERN ".svn" EXCLUDE 182 | ) 183 | 184 | ## Mark other files for installation (e.g. launch and bag files, etc.) 185 | # install(FILES 186 | # # myfile1 187 | # # myfile2 188 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 189 | # ) 190 | 191 | ############# 192 | ## Testing ## 193 | ############# 194 | 195 | ## Add gtest based cpp test target and link libraries 196 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_centralised_auction.cpp) 197 | # if(TARGET ${PROJECT_NAME}-test) 198 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 199 | # endif() 200 | 201 | ## Add folders to be run by python nosetests 202 | # catkin_add_nosetests(test) 203 | -------------------------------------------------------------------------------- /centralised_auction/README.md: -------------------------------------------------------------------------------- 1 | # centralised_auction 2 | ROS package for multi robot task allocation. Given a series of task and robot locations, allocates the tasks to robots using sequential single-item auction. 3 | 4 | ## 1. Nodes 5 | ### 1.1 centralised_auction_node 6 | #### 1.1.1 Published Topics 7 | `prefix#/tasks` ([`WaypointArray`](https://github.com/Nick-Sullivan/waypoint_follower/blob/master/waypoint_follower_msgs/msg/WaypointArray.msg)) 8 | 9 | The tasks to be completed, in order. `prefix` is a given parameter, and `#` is the robot ID. 10 | 11 | #### 1.1.2 Parameters 12 | `~prefix` (`string`, default: `robot`) 13 | 14 | The published topic prefix. 15 | 16 | `~tasks` (`array`, default: `[]`) 17 | 18 | The positions (x,y,z) and orientations (x,y,z,w) of the tasks. 19 | 20 | `~robots` (`array`, default: `[]`) 21 | 22 | The positions (x,y,z) of the robots. 23 | -------------------------------------------------------------------------------- /centralised_auction/config/rviz.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz/Displays 3 | Help Height: 78 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | Splitter Ratio: 0.63055557 9 | Tree Height: 775 10 | - Class: rviz/Selection 11 | Name: Selection 12 | - Class: rviz/Tool Properties 13 | Expanded: 14 | - /2D Pose Estimate1 15 | - /2D Nav Goal1 16 | - /Publish Point1 17 | Name: Tool Properties 18 | Splitter Ratio: 0.588679016 19 | - Class: rviz/Views 20 | Expanded: 21 | - /Current View1 22 | Name: Views 23 | Splitter Ratio: 0.5 24 | - Class: rviz/Time 25 | Experimental: false 26 | Name: Time 27 | SyncMode: 0 28 | SyncSource: "" 29 | Visualization Manager: 30 | Class: "" 31 | Displays: 32 | - Alpha: 0.5 33 | Cell Size: 1 34 | Class: rviz/Grid 35 | Color: 160; 160; 164 36 | Enabled: true 37 | Line Style: 38 | Line Width: 0.0299999993 39 | Value: Lines 40 | Name: Grid 41 | Normal Cell Count: 0 42 | Offset: 43 | X: 0 44 | Y: 0 45 | Z: 0 46 | Plane: XY 47 | Plane Cell Count: 10 48 | Reference Frame: 49 | Value: true 50 | - Alpha: 1 51 | Buffer Length: 1 52 | Class: rviz/Path 53 | Color: 25; 255; 0 54 | Enabled: true 55 | Head Diameter: 0.100000001 56 | Head Length: 0.100000001 57 | Length: 0.300000012 58 | Line Style: Lines 59 | Line Width: 0.0299999993 60 | Name: Robot0-WaypointPath 61 | Offset: 62 | X: 0 63 | Y: 0 64 | Z: 0 65 | Pose Color: 0; 255; 0 66 | Pose Style: Arrows 67 | Radius: 0.0299999993 68 | Shaft Diameter: 0.0500000007 69 | Shaft Length: 0.150000006 70 | Topic: /robot0/waypoint_paths 71 | Unreliable: false 72 | Value: true 73 | - Alpha: 1 74 | Buffer Length: 1 75 | Class: rviz/Path 76 | Color: 255; 0; 0 77 | Enabled: true 78 | Head Diameter: 0.100000001 79 | Head Length: 0.100000001 80 | Length: 0.300000012 81 | Line Style: Lines 82 | Line Width: 0.0299999993 83 | Name: Robot1-WaypointPath 84 | Offset: 85 | X: 0 86 | Y: 0 87 | Z: 0 88 | Pose Color: 255; 0; 0 89 | Pose Style: Arrows 90 | Radius: 0.0299999993 91 | Shaft Diameter: 0.0500000007 92 | Shaft Length: 0.150000006 93 | Topic: /robot1/waypoint_paths 94 | Unreliable: false 95 | Value: true 96 | Enabled: true 97 | Global Options: 98 | Background Color: 48; 48; 48 99 | Default Light: true 100 | Fixed Frame: map 101 | Frame Rate: 30 102 | Name: root 103 | Tools: 104 | - Class: rviz/Interact 105 | Hide Inactive Objects: true 106 | - Class: rviz/MoveCamera 107 | - Class: rviz/Select 108 | - Class: rviz/FocusCamera 109 | - Class: rviz/Measure 110 | - Class: rviz/SetInitialPose 111 | Topic: /initialpose 112 | - Class: rviz/SetGoal 113 | Topic: /move_base_simple/goal 114 | - Class: rviz/PublishPoint 115 | Single click: true 116 | Topic: /clicked_point 117 | Value: true 118 | Views: 119 | Current: 120 | Class: rviz/Orbit 121 | Distance: 10.4669018 122 | Enable Stereo Rendering: 123 | Stereo Eye Separation: 0.0599999987 124 | Stereo Focal Distance: 1 125 | Swap Stereo Eyes: false 126 | Value: false 127 | Focal Point: 128 | X: 0 129 | Y: 0 130 | Z: 0 131 | Focal Shape Fixed Size: true 132 | Focal Shape Size: 0.0500000007 133 | Invert Z Axis: false 134 | Name: Current View 135 | Near Clip Distance: 0.00999999978 136 | Pitch: 1.3154 137 | Target Frame: 138 | Value: Orbit (rviz) 139 | Yaw: 1.54540002 140 | Saved: ~ 141 | Window Geometry: 142 | Displays: 143 | collapsed: false 144 | Height: 1056 145 | Hide Left Dock: false 146 | Hide Right Dock: true 147 | QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006400fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000dd00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000336fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000002800000336000000b000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000005cf0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 148 | Selection: 149 | collapsed: false 150 | Time: 151 | collapsed: false 152 | Tool Properties: 153 | collapsed: false 154 | Views: 155 | collapsed: true 156 | Width: 1855 157 | X: 65 158 | Y: 24 159 | -------------------------------------------------------------------------------- /centralised_auction/config/rviz3.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz/Displays 3 | Help Height: 78 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | Splitter Ratio: 0.613888979 9 | Tree Height: 775 10 | - Class: rviz/Selection 11 | Name: Selection 12 | - Class: rviz/Tool Properties 13 | Expanded: 14 | - /2D Pose Estimate1 15 | - /2D Nav Goal1 16 | - /Publish Point1 17 | Name: Tool Properties 18 | Splitter Ratio: 0.588679016 19 | - Class: rviz/Views 20 | Expanded: 21 | - /Current View1 22 | Name: Views 23 | Splitter Ratio: 0.5 24 | - Class: rviz/Time 25 | Experimental: false 26 | Name: Time 27 | SyncMode: 0 28 | SyncSource: "" 29 | Visualization Manager: 30 | Class: "" 31 | Displays: 32 | - Alpha: 0.5 33 | Cell Size: 1 34 | Class: rviz/Grid 35 | Color: 160; 160; 164 36 | Enabled: true 37 | Line Style: 38 | Line Width: 0.0299999993 39 | Value: Lines 40 | Name: Grid 41 | Normal Cell Count: 0 42 | Offset: 43 | X: 0 44 | Y: 0 45 | Z: 0 46 | Plane: XY 47 | Plane Cell Count: 10 48 | Reference Frame: 49 | Value: true 50 | - Alpha: 1 51 | Class: rviz/RobotModel 52 | Collision Enabled: false 53 | Enabled: true 54 | Links: 55 | All Links Enabled: true 56 | Expand Joint Details: false 57 | Expand Link Details: false 58 | Expand Tree: false 59 | Link Tree Style: Links in Alphabetic Order 60 | base_link: 61 | Alpha: 1 62 | Show Axes: false 63 | Show Trail: false 64 | chassis_link: 65 | Alpha: 1 66 | Show Axes: false 67 | Show Trail: false 68 | Value: true 69 | fenders_link: 70 | Alpha: 1 71 | Show Axes: false 72 | Show Trail: false 73 | Value: true 74 | front_camera: 75 | Alpha: 1 76 | Show Axes: false 77 | Show Trail: false 78 | Value: true 79 | front_camera_mount: 80 | Alpha: 1 81 | Show Axes: false 82 | Show Trail: false 83 | front_camera_optical: 84 | Alpha: 1 85 | Show Axes: false 86 | Show Trail: false 87 | front_camera_pivot: 88 | Alpha: 1 89 | Show Axes: false 90 | Show Trail: false 91 | front_left_wheel_link: 92 | Alpha: 1 93 | Show Axes: false 94 | Show Trail: false 95 | Value: true 96 | front_mount: 97 | Alpha: 1 98 | Show Axes: false 99 | Show Trail: false 100 | front_right_wheel_link: 101 | Alpha: 1 102 | Show Axes: false 103 | Show Trail: false 104 | Value: true 105 | imu_link: 106 | Alpha: 1 107 | Show Axes: false 108 | Show Trail: false 109 | mid_mount: 110 | Alpha: 1 111 | Show Axes: false 112 | Show Trail: false 113 | navsat_link: 114 | Alpha: 1 115 | Show Axes: false 116 | Show Trail: false 117 | Value: true 118 | rear_camera: 119 | Alpha: 1 120 | Show Axes: false 121 | Show Trail: false 122 | Value: true 123 | rear_left_wheel_link: 124 | Alpha: 1 125 | Show Axes: false 126 | Show Trail: false 127 | Value: true 128 | rear_mount: 129 | Alpha: 1 130 | Show Axes: false 131 | Show Trail: false 132 | rear_right_wheel_link: 133 | Alpha: 1 134 | Show Axes: false 135 | Show Trail: false 136 | Value: true 137 | Name: Jackal0-RobotModel 138 | Robot Description: jackal0/robot_description 139 | TF Prefix: jackal0 140 | Update Interval: 0 141 | Value: true 142 | Visual Enabled: true 143 | - Alpha: 1 144 | Buffer Length: 1 145 | Class: rviz/Path 146 | Color: 25; 255; 0 147 | Enabled: false 148 | Head Diameter: 0.300000012 149 | Head Length: 0.200000003 150 | Length: 0.300000012 151 | Line Style: Lines 152 | Line Width: 0.0299999993 153 | Name: Jackal0-GoalPath 154 | Offset: 155 | X: 0 156 | Y: 0 157 | Z: 0 158 | Pose Color: 255; 85; 255 159 | Pose Style: None 160 | Radius: 0.0299999993 161 | Shaft Diameter: 0.100000001 162 | Shaft Length: 0.100000001 163 | Topic: /jackal0/move_base/NavfnROS/plan 164 | Unreliable: false 165 | Value: false 166 | - Alpha: 1 167 | Buffer Length: 1 168 | Class: rviz/Path 169 | Color: 25; 255; 0 170 | Enabled: true 171 | Head Diameter: 0.100000001 172 | Head Length: 0.100000001 173 | Length: 0.300000012 174 | Line Style: Lines 175 | Line Width: 0.0299999993 176 | Name: Jackal0-WaypointPath 177 | Offset: 178 | X: 0 179 | Y: 0 180 | Z: 0 181 | Pose Color: 0; 255; 0 182 | Pose Style: Arrows 183 | Radius: 0.0299999993 184 | Shaft Diameter: 0.0500000007 185 | Shaft Length: 0.150000006 186 | Topic: /jackal0/waypoint_paths 187 | Unreliable: false 188 | Value: true 189 | - Alpha: 1 190 | Class: rviz/RobotModel 191 | Collision Enabled: false 192 | Enabled: true 193 | Links: 194 | All Links Enabled: true 195 | Expand Joint Details: false 196 | Expand Link Details: false 197 | Expand Tree: false 198 | Link Tree Style: Links in Alphabetic Order 199 | base_link: 200 | Alpha: 1 201 | Show Axes: false 202 | Show Trail: false 203 | chassis_link: 204 | Alpha: 1 205 | Show Axes: false 206 | Show Trail: false 207 | Value: true 208 | fenders_link: 209 | Alpha: 1 210 | Show Axes: false 211 | Show Trail: false 212 | Value: true 213 | front_camera: 214 | Alpha: 1 215 | Show Axes: false 216 | Show Trail: false 217 | Value: true 218 | front_camera_mount: 219 | Alpha: 1 220 | Show Axes: false 221 | Show Trail: false 222 | front_camera_optical: 223 | Alpha: 1 224 | Show Axes: false 225 | Show Trail: false 226 | front_camera_pivot: 227 | Alpha: 1 228 | Show Axes: false 229 | Show Trail: false 230 | front_left_wheel_link: 231 | Alpha: 1 232 | Show Axes: false 233 | Show Trail: false 234 | Value: true 235 | front_mount: 236 | Alpha: 1 237 | Show Axes: false 238 | Show Trail: false 239 | front_right_wheel_link: 240 | Alpha: 1 241 | Show Axes: false 242 | Show Trail: false 243 | Value: true 244 | imu_link: 245 | Alpha: 1 246 | Show Axes: false 247 | Show Trail: false 248 | mid_mount: 249 | Alpha: 1 250 | Show Axes: false 251 | Show Trail: false 252 | navsat_link: 253 | Alpha: 1 254 | Show Axes: false 255 | Show Trail: false 256 | Value: true 257 | rear_camera: 258 | Alpha: 1 259 | Show Axes: false 260 | Show Trail: false 261 | Value: true 262 | rear_left_wheel_link: 263 | Alpha: 1 264 | Show Axes: false 265 | Show Trail: false 266 | Value: true 267 | rear_mount: 268 | Alpha: 1 269 | Show Axes: false 270 | Show Trail: false 271 | rear_right_wheel_link: 272 | Alpha: 1 273 | Show Axes: false 274 | Show Trail: false 275 | Value: true 276 | Name: Jackal1-RobotModel 277 | Robot Description: jackal1/robot_description 278 | TF Prefix: jackal1 279 | Update Interval: 0 280 | Value: true 281 | Visual Enabled: true 282 | - Alpha: 1 283 | Buffer Length: 1 284 | Class: rviz/Path 285 | Color: 255; 0; 0 286 | Enabled: true 287 | Head Diameter: 0.100000001 288 | Head Length: 0.100000001 289 | Length: 0.300000012 290 | Line Style: Lines 291 | Line Width: 0.0299999993 292 | Name: Jackal1-WaypointPath 293 | Offset: 294 | X: 0 295 | Y: 0 296 | Z: 0 297 | Pose Color: 255; 0; 0 298 | Pose Style: Arrows 299 | Radius: 0.0299999993 300 | Shaft Diameter: 0.0500000007 301 | Shaft Length: 0.150000006 302 | Topic: /jackal1/waypoint_paths 303 | Unreliable: false 304 | Value: true 305 | - Alpha: 1 306 | Buffer Length: 1 307 | Class: rviz/Path 308 | Color: 255; 0; 0 309 | Enabled: false 310 | Head Diameter: 0.300000012 311 | Head Length: 0.200000003 312 | Length: 0.300000012 313 | Line Style: Lines 314 | Line Width: 0.0299999993 315 | Name: Jackal1-GoalPath 316 | Offset: 317 | X: 0 318 | Y: 0 319 | Z: 0 320 | Pose Color: 255; 85; 255 321 | Pose Style: None 322 | Radius: 0.0299999993 323 | Shaft Diameter: 0.100000001 324 | Shaft Length: 0.100000001 325 | Topic: /jackal1/move_base/NavfnROS/plan 326 | Unreliable: false 327 | Value: false 328 | Enabled: true 329 | Global Options: 330 | Background Color: 48; 48; 48 331 | Default Light: true 332 | Fixed Frame: map 333 | Frame Rate: 30 334 | Name: root 335 | Tools: 336 | - Class: rviz/Interact 337 | Hide Inactive Objects: true 338 | - Class: rviz/MoveCamera 339 | - Class: rviz/Select 340 | - Class: rviz/FocusCamera 341 | - Class: rviz/Measure 342 | - Class: rviz/SetInitialPose 343 | Topic: /initialpose 344 | - Class: rviz/SetGoal 345 | Topic: /move_base_simple/goal 346 | - Class: rviz/PublishPoint 347 | Single click: true 348 | Topic: /clicked_point 349 | Value: true 350 | Views: 351 | Current: 352 | Class: rviz/Orbit 353 | Distance: 10.1151791 354 | Enable Stereo Rendering: 355 | Stereo Eye Separation: 0.0599999987 356 | Stereo Focal Distance: 1 357 | Swap Stereo Eyes: false 358 | Value: false 359 | Focal Point: 360 | X: -0.801429391 361 | Y: 0.163161471 362 | Z: -1.11489451 363 | Focal Shape Fixed Size: true 364 | Focal Shape Size: 0.0500000007 365 | Invert Z Axis: false 366 | Name: Current View 367 | Near Clip Distance: 0.00999999978 368 | Pitch: 0.820400476 369 | Target Frame: 370 | Value: Orbit (rviz) 371 | Yaw: 3.13859034 372 | Saved: ~ 373 | Window Geometry: 374 | Displays: 375 | collapsed: false 376 | Height: 1056 377 | Hide Left Dock: false 378 | Hide Right Dock: true 379 | QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000336fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000002800000336000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000005cf0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 380 | Selection: 381 | collapsed: false 382 | Time: 383 | collapsed: false 384 | Tool Properties: 385 | collapsed: false 386 | Views: 387 | collapsed: true 388 | Width: 1855 389 | X: 65 390 | Y: 24 391 | -------------------------------------------------------------------------------- /centralised_auction/config/rviz4.rviz: -------------------------------------------------------------------------------- 1 | Panels: 2 | - Class: rviz/Displays 3 | Help Height: 78 4 | Name: Displays 5 | Property Tree Widget: 6 | Expanded: 7 | - /Global Options1 8 | Splitter Ratio: 0.613888979 9 | Tree Height: 775 10 | - Class: rviz/Selection 11 | Name: Selection 12 | - Class: rviz/Tool Properties 13 | Expanded: 14 | - /2D Pose Estimate1 15 | - /2D Nav Goal1 16 | - /Publish Point1 17 | Name: Tool Properties 18 | Splitter Ratio: 0.588679016 19 | - Class: rviz/Views 20 | Expanded: 21 | - /Current View1 22 | Name: Views 23 | Splitter Ratio: 0.5 24 | - Class: rviz/Time 25 | Experimental: false 26 | Name: Time 27 | SyncMode: 0 28 | SyncSource: "" 29 | Visualization Manager: 30 | Class: "" 31 | Displays: 32 | - Alpha: 0.5 33 | Cell Size: 1 34 | Class: rviz/Grid 35 | Color: 160; 160; 164 36 | Enabled: true 37 | Line Style: 38 | Line Width: 0.0299999993 39 | Value: Lines 40 | Name: Grid 41 | Normal Cell Count: 0 42 | Offset: 43 | X: 0 44 | Y: 0 45 | Z: 0 46 | Plane: XY 47 | Plane Cell Count: 50 48 | Reference Frame: 49 | Value: true 50 | - Alpha: 1 51 | Class: rviz/RobotModel 52 | Collision Enabled: false 53 | Enabled: true 54 | Links: 55 | All Links Enabled: true 56 | Expand Joint Details: false 57 | Expand Link Details: false 58 | Expand Tree: false 59 | Link Tree Style: Links in Alphabetic Order 60 | base_link: 61 | Alpha: 1 62 | Show Axes: false 63 | Show Trail: false 64 | chassis_link: 65 | Alpha: 1 66 | Show Axes: false 67 | Show Trail: false 68 | Value: true 69 | fenders_link: 70 | Alpha: 1 71 | Show Axes: false 72 | Show Trail: false 73 | Value: true 74 | front_camera: 75 | Alpha: 1 76 | Show Axes: false 77 | Show Trail: false 78 | Value: true 79 | front_camera_mount: 80 | Alpha: 1 81 | Show Axes: false 82 | Show Trail: false 83 | front_camera_optical: 84 | Alpha: 1 85 | Show Axes: false 86 | Show Trail: false 87 | front_camera_pivot: 88 | Alpha: 1 89 | Show Axes: false 90 | Show Trail: false 91 | front_left_wheel_link: 92 | Alpha: 1 93 | Show Axes: false 94 | Show Trail: false 95 | Value: true 96 | front_mount: 97 | Alpha: 1 98 | Show Axes: false 99 | Show Trail: false 100 | front_right_wheel_link: 101 | Alpha: 1 102 | Show Axes: false 103 | Show Trail: false 104 | Value: true 105 | imu_link: 106 | Alpha: 1 107 | Show Axes: false 108 | Show Trail: false 109 | mid_mount: 110 | Alpha: 1 111 | Show Axes: false 112 | Show Trail: false 113 | navsat_link: 114 | Alpha: 1 115 | Show Axes: false 116 | Show Trail: false 117 | Value: true 118 | rear_camera: 119 | Alpha: 1 120 | Show Axes: false 121 | Show Trail: false 122 | Value: true 123 | rear_left_wheel_link: 124 | Alpha: 1 125 | Show Axes: false 126 | Show Trail: false 127 | Value: true 128 | rear_mount: 129 | Alpha: 1 130 | Show Axes: false 131 | Show Trail: false 132 | rear_right_wheel_link: 133 | Alpha: 1 134 | Show Axes: false 135 | Show Trail: false 136 | Value: true 137 | Name: Jackal0-RobotModel 138 | Robot Description: jackal0/robot_description 139 | TF Prefix: jackal0 140 | Update Interval: 0 141 | Value: true 142 | Visual Enabled: true 143 | - Alpha: 1 144 | Buffer Length: 1 145 | Class: rviz/Path 146 | Color: 25; 255; 0 147 | Enabled: true 148 | Head Diameter: 0.300000012 149 | Head Length: 0.200000003 150 | Length: 0.300000012 151 | Line Style: Lines 152 | Line Width: 0.0299999993 153 | Name: Jackal0-CompletedPath 154 | Offset: 155 | X: 0 156 | Y: 0 157 | Z: 0 158 | Pose Color: 255; 85; 255 159 | Pose Style: None 160 | Radius: 0.0299999993 161 | Shaft Diameter: 0.100000001 162 | Shaft Length: 0.100000001 163 | Topic: /jackal0/completed_paths 164 | Unreliable: false 165 | Value: true 166 | - Alpha: 1 167 | Buffer Length: 1 168 | Class: rviz/Path 169 | Color: 25; 255; 0 170 | Enabled: true 171 | Head Diameter: 0.100000001 172 | Head Length: 0.100000001 173 | Length: 0.300000012 174 | Line Style: Lines 175 | Line Width: 0.0299999993 176 | Name: Jackal0-WaypointPath 177 | Offset: 178 | X: 0 179 | Y: 0 180 | Z: 0 181 | Pose Color: 0; 255; 0 182 | Pose Style: Arrows 183 | Radius: 0.0299999993 184 | Shaft Diameter: 0.0500000007 185 | Shaft Length: 0.150000006 186 | Topic: /jackal0/waypoint_paths 187 | Unreliable: false 188 | Value: true 189 | - Alpha: 1 190 | Class: rviz/RobotModel 191 | Collision Enabled: false 192 | Enabled: true 193 | Links: 194 | All Links Enabled: true 195 | Expand Joint Details: false 196 | Expand Link Details: false 197 | Expand Tree: false 198 | Link Tree Style: Links in Alphabetic Order 199 | base_link: 200 | Alpha: 1 201 | Show Axes: false 202 | Show Trail: false 203 | chassis_link: 204 | Alpha: 1 205 | Show Axes: false 206 | Show Trail: false 207 | Value: true 208 | fenders_link: 209 | Alpha: 1 210 | Show Axes: false 211 | Show Trail: false 212 | Value: true 213 | front_camera: 214 | Alpha: 1 215 | Show Axes: false 216 | Show Trail: false 217 | Value: true 218 | front_camera_mount: 219 | Alpha: 1 220 | Show Axes: false 221 | Show Trail: false 222 | front_camera_optical: 223 | Alpha: 1 224 | Show Axes: false 225 | Show Trail: false 226 | front_camera_pivot: 227 | Alpha: 1 228 | Show Axes: false 229 | Show Trail: false 230 | front_left_wheel_link: 231 | Alpha: 1 232 | Show Axes: false 233 | Show Trail: false 234 | Value: true 235 | front_mount: 236 | Alpha: 1 237 | Show Axes: false 238 | Show Trail: false 239 | front_right_wheel_link: 240 | Alpha: 1 241 | Show Axes: false 242 | Show Trail: false 243 | Value: true 244 | imu_link: 245 | Alpha: 1 246 | Show Axes: false 247 | Show Trail: false 248 | mid_mount: 249 | Alpha: 1 250 | Show Axes: false 251 | Show Trail: false 252 | navsat_link: 253 | Alpha: 1 254 | Show Axes: false 255 | Show Trail: false 256 | Value: true 257 | rear_camera: 258 | Alpha: 1 259 | Show Axes: false 260 | Show Trail: false 261 | Value: true 262 | rear_left_wheel_link: 263 | Alpha: 1 264 | Show Axes: false 265 | Show Trail: false 266 | Value: true 267 | rear_mount: 268 | Alpha: 1 269 | Show Axes: false 270 | Show Trail: false 271 | rear_right_wheel_link: 272 | Alpha: 1 273 | Show Axes: false 274 | Show Trail: false 275 | Value: true 276 | Name: Jackal1-RobotModel 277 | Robot Description: jackal1/robot_description 278 | TF Prefix: jackal1 279 | Update Interval: 0 280 | Value: true 281 | Visual Enabled: true 282 | - Alpha: 1 283 | Buffer Length: 1 284 | Class: rviz/Path 285 | Color: 255; 0; 0 286 | Enabled: true 287 | Head Diameter: 0.100000001 288 | Head Length: 0.100000001 289 | Length: 0.300000012 290 | Line Style: Lines 291 | Line Width: 0.0299999993 292 | Name: Jackal1-WaypointPath 293 | Offset: 294 | X: 0 295 | Y: 0 296 | Z: 0 297 | Pose Color: 255; 0; 0 298 | Pose Style: Arrows 299 | Radius: 0.0299999993 300 | Shaft Diameter: 0.0500000007 301 | Shaft Length: 0.150000006 302 | Topic: /jackal1/waypoint_paths 303 | Unreliable: false 304 | Value: true 305 | - Alpha: 1 306 | Buffer Length: 1 307 | Class: rviz/Path 308 | Color: 255; 0; 0 309 | Enabled: true 310 | Head Diameter: 0.300000012 311 | Head Length: 0.200000003 312 | Length: 0.300000012 313 | Line Style: Lines 314 | Line Width: 0.0299999993 315 | Name: Jackal1-CompletedPath 316 | Offset: 317 | X: 0 318 | Y: 0 319 | Z: 0 320 | Pose Color: 255; 85; 255 321 | Pose Style: None 322 | Radius: 0.0299999993 323 | Shaft Diameter: 0.100000001 324 | Shaft Length: 0.100000001 325 | Topic: /jackal1/completed_paths 326 | Unreliable: false 327 | Value: true 328 | - Class: rviz/Axes 329 | Enabled: true 330 | Length: 1 331 | Name: Axes 332 | Radius: 0.100000001 333 | Reference Frame: 334 | Value: true 335 | Enabled: true 336 | Global Options: 337 | Background Color: 48; 48; 48 338 | Default Light: true 339 | Fixed Frame: map 340 | Frame Rate: 30 341 | Name: root 342 | Tools: 343 | - Class: rviz/Interact 344 | Hide Inactive Objects: true 345 | - Class: rviz/MoveCamera 346 | - Class: rviz/Select 347 | - Class: rviz/FocusCamera 348 | - Class: rviz/Measure 349 | - Class: rviz/SetInitialPose 350 | Topic: /initialpose 351 | - Class: rviz/SetGoal 352 | Topic: /move_base_simple/goal 353 | - Class: rviz/PublishPoint 354 | Single click: true 355 | Topic: /clicked_point 356 | Value: true 357 | Views: 358 | Current: 359 | Class: rviz/Orbit 360 | Distance: 9.33142185 361 | Enable Stereo Rendering: 362 | Stereo Eye Separation: 0.0599999987 363 | Stereo Focal Distance: 1 364 | Swap Stereo Eyes: false 365 | Value: false 366 | Focal Point: 367 | X: 7.35214615 368 | Y: 4.49784231 369 | Z: 3.07835579 370 | Focal Shape Fixed Size: true 371 | Focal Shape Size: 0.0500000007 372 | Invert Z Axis: false 373 | Name: Current View 374 | Near Clip Distance: 0.00999999978 375 | Pitch: 1.56979632 376 | Target Frame: 377 | Value: Orbit (rviz) 378 | Yaw: 4.70859766 379 | Saved: ~ 380 | Window Geometry: 381 | Displays: 382 | collapsed: false 383 | Height: 1056 384 | Hide Left Dock: false 385 | Hide Right Dock: true 386 | QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000396fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000002800000396000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d00650100000000000004500000000000000000000005cf0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 387 | Selection: 388 | collapsed: false 389 | Time: 390 | collapsed: false 391 | Tool Properties: 392 | collapsed: false 393 | Views: 394 | collapsed: true 395 | Width: 1855 396 | X: 65 397 | Y: 24 398 | -------------------------------------------------------------------------------- /centralised_auction/include/centralised_auction/sequential_auction.h: -------------------------------------------------------------------------------- 1 | #ifndef SEQUENTIAL_AUCTION_H 2 | #define SEQUENTIAL_AUCTION_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "task_msgs/Task.h" 8 | #include "task_msgs/TaskArray.h" 9 | #include "geometry_msgs/Pose.h" 10 | 11 | using std::cout; 12 | using std::endl; 13 | using std::vector; 14 | using task_msgs::Task; 15 | using task_msgs::TaskArray; 16 | using geometry_msgs::Pose; 17 | 18 | 19 | class SequentialAuction { 20 | public: 21 | bool use_least_contested_bid; 22 | bool return_home; 23 | 24 | SequentialAuction(vector unallocated_tasks, 25 | vector robot_poses); 26 | vector allocateTasks(); 27 | 28 | private: 29 | // These variables are unchanged through allocation. 30 | int num_robots; 31 | int num_tasks; 32 | vector robot_poses; 33 | vector tasks; 34 | // Working variables for alloction. 35 | vector unalloc; 36 | vector< vector > paths; //consider changing to lists for efficiency 37 | vector path_costs; 38 | vector< vector > bids; 39 | 40 | // Output variable from allocation. 41 | vector allocations; 42 | 43 | void formOutput(); 44 | void processWinner(int winning_robot, int winning_task); 45 | void selectWinner(int &winning_robot, int &winning_task); 46 | void prepareAllocations(); 47 | void calculateAllBids(); 48 | void calculateBids(int robot_num); 49 | double insertTask( int robot_num, int unalloc_id, vector& new_path); 50 | double calculatePathCost( int robot_num, vector path ); 51 | void printPaths(); 52 | void printPath( vector path ); 53 | void printBids(); 54 | 55 | }; 56 | 57 | 58 | #endif //SEQUENTIAL_AUCTION_H 59 | -------------------------------------------------------------------------------- /centralised_auction/launch/example1.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 11 | 13 | [ 1, -1, 0, 0, 0, 0, 1, 14 | -1, 1, 0, 0, 0, 0, 1, 15 | 2, -2, 0, 0, 0, 0, 1, 16 | -2, -4, 0, 0, 0, 0, 1] 17 | 18 | [1, 0, 0, 19 | -1, 0, 0] 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /centralised_auction/launch/example2.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 11 | 13 | [ 1, -1, 0, 0, 0, 0, 1, 14 | -1, 1, 0, 0, 0, 0, 1, 15 | 2, -2, 0, 0, 0, 0, 1, 16 | -2, -4, 0, 0, 0, 0, 1] 17 | 18 | [1, 0, 0, 19 | -1, 0, 0] 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 38 | 40 | 41 | 43 | 45 | 46 | 47 | 48 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /centralised_auction/launch/example3.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 26 | 27 | 28 | [-4, 2, 0, 0, 0, 0, 1, 29 | -3,-4, 0, 0, 0, 0, 1, 30 | -1,-4, 0, 0, 0, 0, 1, 31 | -1, 2, 0, 0, 0, 0, 1, 32 | 3, 4, 0, 0, 0, 0, 1, 33 | 4, 4, 0, 0, 0, 0, 1, 34 | 3,-4, 0, 0, 0, 0, 1] 35 | 36 | [0, 0, 0] 37 | 38 | 39 | 40 | 42 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /centralised_auction/launch/example4.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 33 | 34 | [-4, 2, 0, 0, 0, 0, 1, 35 | -3,-4, 0, 0, 0, 0, 1, 36 | -1,-4, 0, 0, 0, 0, 1, 37 | -1, 2, 0, 0, 0, 0, 1, 38 | 3, 4, 0, 0, 0, 0, 1, 39 | 4, 4, 0, 0, 0, 0, 1, 40 | 3,-4, 0, 0, 0, 0, 1] 41 | 42 | [0, 0, 0, 43 | -1, 0, 0] 44 | 45 | 46 | 47 | 49 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /centralised_auction/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | centralised_auction 4 | 0.0.0 5 | The centralised_auction package 6 | 7 | 8 | 9 | 10 | nick 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | catkin 52 | roscpp 53 | nav_msgs 54 | std_msgs 55 | waypoint_follower 56 | waypoint_follower_msgs 57 | task_msgs 58 | multi_jackal_tutorials 59 | roscpp 60 | nav_msgs 61 | std_msgs 62 | waypoint_follower 63 | waypoint_follower_msgs 64 | task_msgs 65 | multi_jackal_tutorials 66 | roscpp 67 | nav_msgs 68 | std_msgs 69 | waypoint_follower 70 | waypoint_follower_msgs 71 | task_msgs 72 | multi_jackal_tutorials 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /centralised_auction/src/centralised_auction_node.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "task_msgs/Task.h" 5 | #include "task_msgs/TaskArray.h" 6 | #include "geometry_msgs/Pose.h" 7 | #include "geometry_msgs/PoseArray.h" 8 | //#include "waypoint_follower_msgs/Waypoint.h" 9 | //#include "waypoint_follower_msgs/WaypointStamped.h" 10 | #include "waypoint_follower_msgs/WaypointArray.h" 11 | 12 | #include "centralised_auction/sequential_auction.h" 13 | 14 | using std::vector; 15 | using std::cout; 16 | using std::endl; 17 | using std::string; 18 | using task_msgs::Task; 19 | using task_msgs::TaskArray; 20 | using geometry_msgs::Pose; 21 | using geometry_msgs::PoseArray; 22 | using geometry_msgs::PoseStamped; 23 | using waypoint_follower_msgs::WaypointArray; 24 | 25 | 26 | vector unallocated_tasks; 27 | vector robot_poses; 28 | 29 | vector allocated_tasks; 30 | 31 | vector pubs; 32 | int num_robots; 33 | int seq = 0; 34 | string prefix; 35 | bool return_home; 36 | 37 | /************************************************** 38 | * Helper functions 39 | **************************************************/ 40 | 41 | // Converts from TaskArray format to PoseArray format. 42 | PoseArray taskArrayToPoseArray( TaskArray ta ){ 43 | PoseArray pa; 44 | pa.header.seq = seq++; 45 | pa.header.stamp = ros::Time::now(); 46 | pa.header.frame_id = "map"; 47 | for( int i=0; i(strs.str(), 100) ); 137 | pubs.push_back( n.advertise(strs.str(), 100) ); 138 | } 139 | } 140 | 141 | // Loads parameters from the launch file. Uses default values if any values are 142 | // missing. 143 | void loadParams(ros::NodeHandle n_priv){ 144 | vector waypoint_values; //position (x,y,z) and orientation (x,y,z,w) 145 | vector robot_values; //position (x,y,z) 146 | 147 | // Set default parameters. 148 | double default_waypoint_values[] = {}; 149 | double default_robot_values[] = {}; 150 | string default_prefix = "robot"; 151 | bool default_return_home = true; 152 | 153 | n_priv.param("return_home", return_home, default_return_home); 154 | n_priv.param("prefix", prefix, default_prefix); 155 | 156 | // Check parameter server to override defaults. 157 | XmlRpc::XmlRpcValue v; 158 | if( n_priv.getParam("tasks", v) ){ 159 | ROS_ASSERT(v.getType() == XmlRpc::XmlRpcValue::TypeArray); 160 | for(int i=0; i < v.size(); i++) { 161 | if( v[i].getType() == XmlRpc::XmlRpcValue::TypeDouble ) { 162 | waypoint_values.push_back(v[i]); 163 | } 164 | if( v[i].getType() == XmlRpc::XmlRpcValue::TypeInt ) { 165 | int d = v[i]; 166 | waypoint_values.push_back(d); 167 | } 168 | } 169 | } else { 170 | waypoint_values.assign(default_waypoint_values, default_waypoint_values + 171 | sizeof(default_waypoint_values) / sizeof(default_waypoint_values[0]) ); 172 | } 173 | // Convert waypoint values into waypoints. 174 | if( waypoint_values.size() % 7 != 0 ){ 175 | cout << "INCORRECT NUMBER OF WAYPOINT VALUES" << endl; 176 | return; 177 | } 178 | for( int i=0; i unallocated_tasks, 9 | vector robot_poses){ 10 | this->tasks = unallocated_tasks; 11 | this->num_tasks = unallocated_tasks.size(); 12 | this->robot_poses = robot_poses; 13 | this->num_robots = robot_poses.size(); 14 | return_home = false; 15 | use_least_contested_bid = false; 16 | } 17 | 18 | // The allocation procedure. Each iteration, selects a winner to allocate and 19 | // recalculates bids. 20 | vector SequentialAuction::allocateTasks(){ 21 | int winning_robot, winning_task; 22 | prepareAllocations(); 23 | calculateAllBids(); 24 | while( !unalloc.empty() ){ 25 | //cout << "The bids are: " << endl; 26 | //printBids(); 27 | selectWinner(winning_robot, winning_task); 28 | //cout << "winner is: " << winning_robot << ", " << winning_task << endl; 29 | processWinner(winning_robot, winning_task); 30 | calculateBids(winning_robot); 31 | } 32 | cout << "Allocations: " << endl; 33 | printPaths(); 34 | 35 | formOutput(); 36 | return allocations; 37 | } 38 | 39 | /******************************************** 40 | * Allocation processing (medium level) 41 | ********************************************/ 42 | 43 | // Clears paths, sets the correct size for bidding matrix. 44 | void SequentialAuction::prepareAllocations(){ 45 | unalloc.clear(); 46 | paths.clear(); 47 | path_costs.clear(); 48 | bids.clear(); 49 | allocations.clear(); 50 | for( int i=0; i v; 55 | paths.push_back( v ); 56 | path_costs.push_back(0); 57 | } 58 | for( int i=0; i v; 60 | for( int j=0; j new_path; 81 | double new_cost = insertTask( robot_num, unalloc[i], new_path ); 82 | // Bid the new path cost. 83 | bids[robot_num][unalloc[i]] = new_cost; 84 | } 85 | } 86 | 87 | // Selects the winning robot and task by the minimum non-negative bid. 88 | void SequentialAuction::selectWinner(int &winning_robot, int &winning_task){ 89 | // Option - winner is the least contested bid. 90 | if( use_least_contested_bid && num_robots > 1){ 91 | double max_bid_diff, min_bid, min_bid2, bid_diff, bid; 92 | int temp_winning_robot = -1; 93 | max_bid_diff = -1; 94 | for( int j=0; j= 0){ 100 | min_bid2 = min_bid; 101 | min_bid = bid; 102 | temp_winning_robot = i; 103 | continue; 104 | } 105 | if( (bid < min_bid2 || min_bid2 == -1) && bid >= 0){ 106 | min_bid2 = bid; 107 | } 108 | } 109 | bid_diff = min_bid2 - min_bid; 110 | if( bid_diff > max_bid_diff ) { 111 | max_bid_diff = bid_diff; 112 | winning_task = j; 113 | winning_robot = temp_winning_robot; 114 | } 115 | } 116 | return; 117 | } 118 | // Option (default) - winner is the lowest bid. 119 | double min_bid = -1; 120 | for( int i=0; i= 0 ){ 124 | min_bid = bid; 125 | winning_robot = i; 126 | winning_task = j; 127 | } 128 | } 129 | } 130 | } 131 | 132 | // Adds the winning task to the winning robots path, and removes the task from 133 | // the unallocated list. Also sets all bids for the winning task to -1. 134 | void SequentialAuction::processWinner(int winning_robot, int winning_task){ 135 | insertTask( winning_robot, winning_task, paths[winning_robot]); 136 | for( int i=0; i path = paths[i]; 153 | for( int j=0; j& new_path){ 168 | vector path = paths[robot_num]; 169 | double path_cost; 170 | vector best_path; 171 | double best_path_cost = -1; 172 | for( int i=0; i<=path.size(); i++ ){ 173 | path.insert( path.begin()+i, unalloc_id ); 174 | //printPath( path ); 175 | path_cost = calculatePathCost( robot_num, path ); 176 | //cout << "cost: " << path_cost << endl; 177 | if( path_cost < best_path_cost || best_path_cost == -1 ){ 178 | best_path_cost = path_cost; 179 | best_path = path; 180 | } 181 | path.erase( path.begin()+i ); 182 | } 183 | 184 | new_path = best_path; 185 | return best_path_cost; 186 | } 187 | 188 | // Calculates the cost to go from the robots start pose to each task in order, 189 | // then returning home (optionally). 190 | double SequentialAuction::calculatePathCost( int robot_num, vector path ){ 191 | double dist = 0; 192 | double x_prev, y_prev, x_next, y_next, x_diff, y_diff; 193 | int task_id; 194 | x_prev = robot_poses[robot_num].position.x; 195 | y_prev = robot_poses[robot_num].position.y; 196 | for( int i=0; i path ){ 227 | cout << "[ "; 228 | for( int i=0; i 2 | 3 | task_msgs 4 | 0.0.0 5 | The task_msgs package 6 | 7 | 8 | 9 | 10 | nick 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | catkin 52 | geometry_msgs 53 | message_generation 54 | std_msgs 55 | geometry_msgs 56 | std_msgs 57 | message_generation 58 | geometry_msgs 59 | std_msgs 60 | message_runtime 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | --------------------------------------------------------------------------------