Skip to content

Commit f05decc

Browse files
author
Michael Jeronimo
authored
Continue implementation of the architectural shell for the command task hierarchy (#12)
Implement the basic structure for the command chain modules.
1 parent 435db94 commit f05decc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1031
-581
lines changed
File renamed without changes.

src/control/CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ endif()
1313
find_package(ament_cmake REQUIRED)
1414
find_package(rclcpp REQUIRED)
1515
find_package(std_msgs REQUIRED)
16-
find_package(task REQUIRED)
16+
find_package(nav2_msgs REQUIRED)
1717

1818
include_directories(
1919
include
@@ -24,20 +24,18 @@ include_directories(
2424
link_directories(${CMAKE_BINARY_DIR}/../libs)
2525

2626
add_executable(dwa_controller
27-
src/ControlTask.cpp
2827
src/DwaController.cpp
2928
src/main.cpp
3029
)
3130

3231
target_link_libraries(dwa_controller
3332
robot
34-
task
3533
)
3634

3735
ament_target_dependencies(dwa_controller
3836
rclcpp
3937
std_msgs
40-
task
38+
nav2_msgs
4139
robot
4240
)
4341

File renamed without changes.
File renamed without changes.

src/control/include/control/ControlTask.hpp

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,31 @@
1-
// License: Apache 2.0. See LICENSE file in root directory.
2-
// Copyright 2018 Intel Corporation. All Rights Reserved.
1+
// Copyright (c) 2018 Intel Corporation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
314

415
#ifndef CONTROL__DWACONTROLLER_HPP_
516
#define CONTROL__DWACONTROLLER_HPP_
617

7-
#include "control/ControlTask.hpp"
18+
#include <string>
19+
#include "control/FollowPathTaskServer.hpp"
820

9-
class DwaController : public ControlTask
21+
class DwaController : public FollowPathTaskServer
1022
{
1123
public:
12-
DwaController(const std::string & name, Robot * robot);
24+
explicit DwaController(const std::string & name);
1325
DwaController() = delete;
1426
~DwaController();
1527

16-
void executePlan() override;
17-
18-
protected:
19-
void workerThread() override;
28+
TaskStatus executeAsync(const FollowPathCommand::SharedPtr path) override;
2029
};
2130

2231
#endif // CONTROL__DWACONTROLLER_HPP_
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2018 Intel Corporation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef CONTROL__FOLLOWPATHTASKCLIENT_HPP_
16+
#define CONTROL__FOLLOWPATHTASKCLIENT_HPP_
17+
18+
#include "task/TaskClient.hpp"
19+
#include "control/FollowPathTaskMessages.hpp"
20+
21+
using FollowPathTaskClient = TaskClient<FollowPathCommand, FollowPathResult>;
22+
23+
#endif // CONTROL__FOLLOWPATHTASKCLIENT_HPP_
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) 2018 Intel Corporation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef CONTROL__FOLLOWPATHTASKMESSAGES_HPP_
16+
#define CONTROL__FOLLOWPATHTASKMESSAGES_HPP_
17+
18+
#include "nav2_msgs/msg/path.hpp"
19+
#include "std_msgs/msg/empty.hpp"
20+
21+
using FollowPathCommand = nav2_msgs::msg::Path;
22+
using FollowPathResult = std_msgs::msg::Empty;
23+
24+
#endif // CONTROL__FOLLOWPATHTASKMESSAGES_HPP_
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2018 Intel Corporation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
#ifndef CONTROL__FOLLOWPATHTASKSERVER_HPP_
16+
#define CONTROL__FOLLOWPATHTASKSERVER_HPP_
17+
18+
#include "task/TaskServer.hpp"
19+
#include "control/FollowPathTaskMessages.hpp"
20+
21+
using FollowPathTaskServer = TaskServer<FollowPathCommand, FollowPathResult>;
22+
23+
#endif // CONTROL__FOLLOWPATHTASKSERVER_HPP_

src/control/package.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
<license>Apache License 2.0</license>
1010
<buildtool_depend>ament_cmake</buildtool_depend>
1111
<build_depend>rclcpp</build_depend>
12-
<build_depend>task</build_depend>
12+
<build_depend>std_msgs</build_depend>
13+
<build_depend>nav2_msgs</build_depend>
1314
<build_depend>robot</build_depend>
1415
<exec_depend>rclcpp</exec_depend>
16+
<exec_depend>std_msgs</exec_depend>
17+
<exec_depend>nav2_msgs</exec_depend>
1518
<export>
1619
<build_type>ament_cmake</build_type>
1720
</export>

0 commit comments

Comments
 (0)