Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 29 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,28 +89,35 @@ Each of the described example cases from the roadmap has its own launch and URDF
joint2/position
```

3. Open another terminal and load, configure, and start controllers:
```
ros2 control load_start_controller joint_state_controller
ros2 control load_configure_controller forward_command_controller_position
```

Check if the controller is loaded properly:
```
ros2 control list_controllers
```
You should get the response:
```
joint_state_controller[joint_state_controller/JointStateController] active
forward_command_controller_position[forward_command_controller/ForwardCommandController] inactive
```

4. Starting controller:
```
ros2 control switch_controllers --start-controllers forward_command_controller_position
```

Check if controllers are activated:
3. Open another terminal and load, configure and start controllers:
- Using the provided launch file:
```
ros2 launch ros2_control_demo_robot joint_state_controller.launch.py
ros2 launch ros2_control_demo_robot forward_command_controller_position.launch.py
```

- Using `ros2 control` cli interface:
```
ros2 control load_start_controller joint_state_controller
ros2 control load_configure_controller forward_command_controller_position
```

Check if the controller is loaded properly:
```
ros2 control list_controllers
```
You should get the response:
```
joint_state_controller[joint_state_controller/JointStateController] active
forward_command_controller_position[forward_command_controller/ForwardCommandController] inactive
```

Starting controller:
```
ros2 control switch_controllers --start-controllers forward_command_controller_position
```

4. Check if controllers are activated:
```
ros2 control list_controllers
```
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2021 PAL Robotics S.L. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from controller_manager.launch_utils import generate_load_controller_launch_description


def generate_launch_description():
return generate_load_controller_launch_description(
controller_name='forward_command_controller_position',
controller_type=None,
controller_params_file=None)
22 changes: 22 additions & 0 deletions ros2_control_demo_robot/launch/joint_state_controller.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2021 PAL Robotics S.L. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from controller_manager.launch_utils import generate_load_controller_launch_description


def generate_launch_description():
return generate_load_controller_launch_description(
controller_name='joint_state_controller',
controller_type=None,
controller_params_file=None)
2 changes: 2 additions & 0 deletions ros2_control_demo_robot/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

<depend>ros2_control_demo_hardware</depend>

<exec_depend>controller_manager</exec_depend>

<test_depend>ament_cmake_gtest</test_depend>

<export>
Expand Down