Skip to content

Commit 0fdee7e

Browse files
Rename packages using prefix xcub (#31)
2 parents 2989415 + cf29de6 commit 0fdee7e

29 files changed

+75
-67
lines changed

README.md

+23-18
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ source install/setup.bash
8888

8989
### Install as a single CMake project
9090

91-
If you want to build this repository as a single CMake project, you can use the `CMakeLists.txt` provided in `xcub_moveit2_all_packages`:
91+
If you want to build this repository as a single CMake project, you can use the `CMakeLists.txt` provided in `xcub_moveit_all_packages`:
9292

9393
~~~shell
9494
git clone https://github.com/icub-tech-iit/xcub-moveit2/
95-
cd xcub-moveit2/xcub_moveit2_all_packages
95+
cd xcub-moveit2/xcub_moveit_all_packages
9696
cmake -Bbuild -S. -DCMAKE_INSTALL_PREFIX=<install_prefix>
9797
cmake --build build
9898
cmake --install build
@@ -123,15 +123,15 @@ However, if you want to work in simulation instead of on the real hardware, you
123123

124124
This section aims to give a brief description of what each package contains.
125125

126-
### robot_controller
126+
### xcub_ros2_controllers
127127

128-
This package contains `robot_controller` plugin that is used in [ros2_control](https://control.ros.org/master/index.html) framework. It includes:
128+
This package contains `xcub_ros2_controllers` plugin that is used in [ros2_control](https://control.ros.org/master/index.html) framework. It includes:
129129

130130
- a `position state interface` used to read the position of each joint;
131131
- a `velocity state interface` used to read the velocity of each joint;
132132
- a `position command interface` used to forward the desired position to the joints.
133133

134-
### robot_moveit
134+
### xcub_moveit_robot
135135

136136
This package contains some launch files, depending on the nodes you want to run.
137137

@@ -140,11 +140,16 @@ This package contains some launch files, depending on the nodes you want to run.
140140
- **`robot_controls.launch.py`**: this launch file allows to run the `controller manager` node for ros2_control and the nodes for the single controllers (one for each part).
141141
- **`circle_demo.launch.py`** and **`grasp_demo.launch.py`**: as the name suggests, they are two examples of commanding the robot in the cartesian space using `torso + right_arm` as planning group.
142142

143-
144143
Before running the nodes, make sure that your environment variable `YARP_ROBOT_NAME` is properly set with the name of your robot. If not, set it for each shell according to the chosen model, for example:
145144

146145
```shell
147-
export YARP_ROBOT_NAME="icub"
146+
export YARP_ROBOT_NAME="iCubGenova11"
147+
```
148+
149+
or, for simulated models:
150+
151+
```shell
152+
export YARP_ROBOT_NAME="iCubGazeboV2_5"
148153
```
149154

150155
### icub_moveit_config
@@ -155,11 +160,11 @@ This package contains the configuration files to make iCub working with MoveIt2.
155160

156161
It contains the same information described in the previous paragraph, but customized with ergoCub specs.
157162

158-
### test_controller
163+
### xcub_moveit_test_controller
159164

160165
In this folder, a test to sample the reaching space is available. It can be run as a ros2 node with the provided launch file called `test_controller.launch.py`. For this purpose, you can find more info in the [Use case](#use-case) paragraph above.
161166

162-
Moreover, a detailed report about the controller performance can be found [here](https://github.com/icub-tech-iit/xcub-moveit2/blob/master/test_controller/README.md#test-on-the-controller-performance) 📝.
167+
Moreover, a detailed report about the controller performance can be found [here](https://github.com/icub-tech-iit/xcub-moveit2/blob/master/xcub_test_controller/README.md#test-on-the-controller-performance) 📝.
163168

164169
## Use case
165170

@@ -175,10 +180,10 @@ colcon build
175180
source install/setup.bash
176181

177182
# Remember to check if your robot name variable is set. If not:
178-
export YARP_ROBOT_NAME="icub"
183+
export YARP_ROBOT_NAME="iCubGazeboV2_5"
179184

180185
# Launch the start-up nodes
181-
ros2 launch robot_moveit robot_sim.launch.py
186+
ros2 launch xcub_moveit_robot robot_sim.launch.py
182187
```
183188

184189
In this way, both rviz2 and gazebo windows are opened with the iCub model spawned in the two environments. At this point, open another shell, build and source the enviroment and then launch the ros2_control nodes:
@@ -188,10 +193,10 @@ cd ~/<ros2_ws>
188193
source /opt/ros/humble/setup.bash
189194
colcon build
190195
source install/setup.bash
191-
export YARP_ROBOT_NAME="icub"
196+
export YARP_ROBOT_NAME="iCubGazeboV2_5"
192197

193198
# Launch the ros2_control nodes
194-
ros2 launch robot_moveit robot_controls.launch.py
199+
ros2 launch xcub_moveit_robot robot_controls.launch.py
195200
```
196201

197202
To verify that everthing has been done successfully, you can run in a separate shell:
@@ -208,16 +213,16 @@ cd ~/<ros2_ws>
208213
source /opt/ros/humble/setup.bash
209214
colcon build
210215
source install/setup.bash
211-
export YARP_ROBOT_NAME="icub"
216+
export YARP_ROBOT_NAME="iCubGazeboV2_5"
212217

213218
# For the grasping demo
214-
ros2 launch robot_moveit grasp_demo.launch.py
219+
ros2 launch xcub_moveit_robot grasp_demo.launch.py
215220
```
216221

217222
If you want to see iCub performing a circle movement, instead of the last line, you can run:
218223

219224
```shell
220-
ros2 launch robot_moveit circle_demo.launch.py
225+
ros2 launch xcub_moveit_robot circle_demo.launch.py
221226
```
222227

223228
and follow the instructions on the third shell you opened.
@@ -228,10 +233,10 @@ You should have something like this:
228233

229234
### Controller performance
230235

231-
If you want to test the ros2_control `robot_controller` performance, you can rely to the `test_controller` package. It contains a simple script to sample the reaching space in front of iCub model. To run the simulation, please follow the first two steps described in the [Run the demos](#run-the-demos) section. After that, open another shell, source your workspace and then launch:
236+
If you want to test the ros2_control `xcub_ros2_controllers` performance, you can rely to the `xcub_moveit_test_controller` package. It contains a simple script to sample the reaching space in front of iCub model. To run the simulation, please follow the first two steps described in the [Run the demos](#run-the-demos) section. After that, open another shell, source your workspace and then launch:
232237

233238
```shell
234-
ros2 launch test_controller test_controller.launch.py
239+
ros2 launch xcub_moveit_test_controller test_controller.launch.py
235240
```
236241

237242
In this way, the test will start and the acquired data in terms of ideal and real poses are saved in two separated files in your current directory. Finally, you can plot them using the Matlab scripts provided in the `utils` folder.

xcub_moveit2_all_packages/CMakeLists.txt xcub_moveit_all_packages/CMakeLists.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ project(xcub-moveit2)
99

1010
# The order of inclusion was taken from colcon graph output
1111
add_subdirectory(../ergocub_moveit_config ${CMAKE_CURRENT_BINARY_DIR}/ergocub_moveit_config)
12-
add_subdirectory(../grasp_moveit ${CMAKE_CURRENT_BINARY_DIR}/grasp_moveit)
12+
add_subdirectory(../xcub_moveit_grasp ${CMAKE_CURRENT_BINARY_DIR}/xcub_moveit_grasp)
1313
add_subdirectory(../icub_moveit_config ${CMAKE_CURRENT_BINARY_DIR}/icub_moveit_config)
14-
add_subdirectory(../robot_controller ${CMAKE_CURRENT_BINARY_DIR}/robot_controller)
15-
add_subdirectory(../robot_moveit ${CMAKE_CURRENT_BINARY_DIR}/robot_moveit)
16-
add_subdirectory(../test_controller ${CMAKE_CURRENT_BINARY_DIR}/test_controller)
14+
add_subdirectory(../xcub_ros2_controllers ${CMAKE_CURRENT_BINARY_DIR}/xcub_ros2_controllers)
15+
add_subdirectory(../xcub_moveit_robot ${CMAKE_CURRENT_BINARY_DIR}/xcub_moveit_robot)
16+
add_subdirectory(../xcub_moveit_test_controller ${CMAKE_CURRENT_BINARY_DIR}/xcub_moveit_test_controller)
1717

File renamed without changes.

grasp_moveit/CMakeLists.txt xcub_moveit_grasp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.8)
2-
project(grasp_moveit)
2+
project(xcub_moveit_grasp)
33

44
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
55
add_compile_options(-Wall -Wextra -Wpedantic)

grasp_moveit/package.xml xcub_moveit_grasp/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
4-
<name>grasp_moveit</name>
4+
<name>xcub_moveit_grasp</name>
55
<version>0.0.0</version>
66
<description>ROS2 package for grasping task</description>
77
<maintainer email="[email protected]">Martina Gloria</maintainer>
File renamed without changes.

robot_moveit/CMakeLists.txt xcub_moveit_robot/CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.8)
2-
project(robot_moveit)
2+
project(xcub_moveit_robot)
33

44
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
55
add_compile_options(-Wall -Wextra -Wpedantic)
@@ -18,13 +18,13 @@ find_package(hardware_interface REQUIRED)
1818
find_package(yarp_control_msgs REQUIRED)
1919
find_package(YARP REQUIRED)
2020

21-
add_executable(robot_moveit src/robot_moveit.cpp launch/spawn_model.py)
22-
target_include_directories(robot_moveit PUBLIC
21+
add_executable(xcub_moveit_robot src/robot_moveit.cpp launch/spawn_model.py)
22+
target_include_directories(xcub_moveit_robot PUBLIC
2323
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
2424
$<INSTALL_INTERFACE:include>)
25-
target_compile_features(robot_moveit PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
25+
target_compile_features(xcub_moveit_robot PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
2626
ament_target_dependencies(
27-
robot_moveit
27+
xcub_moveit_robot
2828
"moveit_ros_planning_interface"
2929
"rclcpp"
3030
"rclpy"
@@ -38,7 +38,7 @@ ament_target_dependencies(
3838
target_sources(${PROJECT_NAME} PRIVATE src/robot_moveit.cpp)
3939
target_link_libraries(${PROJECT_NAME} ${YARP_LIBRARIES})
4040

41-
install(TARGETS robot_moveit DESTINATION lib/${PROJECT_NAME})
41+
install(TARGETS xcub_moveit_robot DESTINATION lib/${PROJECT_NAME})
4242
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})
4343
install(PROGRAMS launch/spawn_model.py DESTINATION lib/${PROJECT_NAME})
4444

robot_moveit/launch/circle_demo.launch.py xcub_moveit_robot/launch/circle_demo.launch.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ def generate_launch_description():
2020
moveit_config = MoveItConfigsBuilder(robot_name).to_moveit_configs()
2121

2222
circle_demo = Node(
23-
name="robot_moveit",
24-
package="robot_moveit",
25-
executable="robot_moveit",
23+
name="xcub_moveit_robot",
24+
package="xcub_moveit_robot",
25+
executable="xcub_moveit_robot",
2626
output="screen",
2727
parameters=[
2828
moveit_config.robot_description,

robot_moveit/launch/grasp_demo.launch.py xcub_moveit_robot/launch/grasp_demo.launch.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def generate_launch_description():
2121

2222
grasping_demo = Node(
2323
name="grasping",
24-
package="grasp_moveit",
25-
executable="grasp_moveit",
24+
package="xcub_moveit_grasp",
25+
executable="xcub_moveit_grasp",
2626
output="screen",
2727
parameters=[
2828
moveit_config.robot_description,
File renamed without changes.

robot_moveit/launch/robot_controls.launch.py xcub_moveit_robot/launch/robot_controls.launch.py

+14-11
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from launch.actions import RegisterEventHandler
66
from launch.event_handlers import OnProcessExit
77
from ament_index_python.packages import get_package_share_directory
8+
from launch.substitutions import PathJoinSubstitution
89

910
def check_robot_name():
1011
try:
@@ -27,62 +28,64 @@ def generate_launch_description():
2728
"config",
2829
"ros2_controllers.yaml",
2930
)
30-
31+
3132
ros2_control_node = Node(
3233
package="controller_manager",
3334
executable="ros2_control_node",
34-
parameters=[moveit_config.robot_description, ros2_controllers_path,
35-
{"use_sim_time": False}],
36-
output="log",
35+
parameters=[ros2_controllers_path],
36+
output="both",
37+
remappings=[
38+
("~/robot_description", "/robot_description"),
39+
],
3740
)
3841

3942
right_arm_torso_controller_spawner = Node(
4043
package="controller_manager",
4144
executable="spawner",
4245
arguments=["right_arm_torso_controller", "-c", "/controller_manager"],
43-
parameters=[{"use_sim_time": False}],
46+
parameters=[{"use_sim_time": True}],
4447
)
4548

4649
left_arm_controller_spawner = Node(
4750
package="controller_manager",
4851
executable="spawner",
4952
arguments=["left_arm_controller", "-c", "/controller_manager"],
50-
parameters=[{"use_sim_time": False}],
53+
parameters=[{"use_sim_time": True}],
5154
)
5255

5356
right_arm_controller_spawner = Node(
5457
package="controller_manager",
5558
executable="spawner",
5659
arguments=["right_arm_controller", "-c", "/controller_manager", "--inactive"],
57-
parameters=[{"use_sim_time": False}],
60+
parameters=[{"use_sim_time": True}],
5861
)
5962

6063
left_leg_controller_spawner = Node(
6164
package="controller_manager",
6265
executable="spawner",
6366
arguments=["left_leg_controller", "-c", "/controller_manager"],
64-
parameters=[{"use_sim_time": False}],
67+
parameters=[{"use_sim_time": True}],
6568
)
6669

6770
right_leg_controller_spawner = Node(
6871
package="controller_manager",
6972
executable="spawner",
7073
arguments=["right_leg_controller", "-c", "/controller_manager"],
71-
parameters=[{"use_sim_time": False}],
74+
parameters=[{"use_sim_time": True}],
7275
)
7376

7477
head_controller_spawner = Node(
7578
package="controller_manager",
7679
executable="spawner",
7780
arguments=["head_controller", "-c", "/controller_manager"],
78-
parameters=[{"use_sim_time": False}],
81+
parameters=[{"use_sim_time": True}],
7982
)
8083

8184
torso_controller_spawner = Node(
8285
package="controller_manager",
8386
executable="spawner",
8487
arguments=["torso_controller", "-c", "/controller_manager", "--inactive"],
85-
parameters=[{"use_sim_time": False}],
88+
parameters=[{"use_sim_time": True}],
8689
)
8790

8891
return LaunchDescription([

robot_moveit/launch/robot_sim.launch.py xcub_moveit_robot/launch/robot_sim.launch.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def generate_launch_description():
4343
PythonLaunchDescriptionSource([os.path.join(get_package_share_directory('gazebo_ros'), 'launch'), '/gazebo.launch.py'])
4444
)
4545

46-
moveit_config = (
46+
config = (
4747
MoveItConfigsBuilder(robot_name)
4848
.robot_description(file_path="config/"+robot_name+".urdf.xacro")
4949
.robot_description_semantic(file_path="config/"+robot_name+".srdf")
@@ -54,7 +54,7 @@ def generate_launch_description():
5454
)
5555

5656
model_spawner = Node(
57-
package='robot_moveit',
57+
package='xcub_moveit_robot',
5858
executable='spawn_model.py',
5959
name='spawn_entity',
6060
output='screen',
@@ -65,7 +65,7 @@ def generate_launch_description():
6565
executable="robot_state_publisher",
6666
name="robot_state_publisher",
6767
output="both",
68-
parameters=[moveit_config.robot_description,
68+
parameters=[config.robot_description,
6969
{"use_sim_time": True}],
7070
)
7171

@@ -108,9 +108,9 @@ def generate_launch_description():
108108
package="moveit_ros_move_group",
109109
executable="move_group",
110110
output="screen",
111-
parameters=[moveit_config.robot_description,
111+
parameters=[config.robot_description,
112112
robot_description_semantic,
113-
moveit_config.robot_description_kinematics,
113+
config.robot_description_kinematics,
114114
ompl_planning_pipeline_config,
115115
moveit_controllers,
116116
trajectory_execution,
@@ -126,10 +126,10 @@ def generate_launch_description():
126126
name="rviz2",
127127
output="log",
128128
arguments=["-d", rviz_moveit],
129-
parameters=[moveit_config.robot_description,
129+
parameters=[config.robot_description,
130130
robot_description_semantic,
131-
moveit_config.robot_description_kinematics,
132-
moveit_config.planning_pipelines,
131+
config.robot_description_kinematics,
132+
config.planning_pipelines,
133133
ompl_planning_pipeline_config,
134134
planning_scene_monitor_parameters,
135135
{"use_sim_time": True}]
File renamed without changes.

robot_moveit/package.xml xcub_moveit_robot/package.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
33
<package format="3">
4-
<name>robot_moveit</name>
4+
<name>xcub_moveit_robot</name>
55
<version>0.0.0</version>
66
<description>TODO: Package description</description>
77
<maintainer email="[email protected]">martinagloria</maintainer>
File renamed without changes.

test_controller/CMakeLists.txt xcub_moveit_test_controller/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.8)
2-
project(test_controller)
2+
project(xcub_moveit_test_controller)
33

44
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
55
add_compile_options(-Wall -Wextra -Wpedantic)
@@ -35,7 +35,7 @@ ament_target_dependencies(
3535
"hardware_interface"
3636
)
3737

38-
target_sources(test_controller PRIVATE src/test_controller.cpp)
38+
target_sources(xcub_moveit_test_controller PRIVATE src/test_controller.cpp)
3939
target_link_libraries(${PROJECT_NAME} ${YARP_LIBRARIES})
4040

4141
install(TARGETS ${PROJECT_NAME} DESTINATION lib/${PROJECT_NAME})
File renamed without changes.

test_controller/launch/test_controller.launch.py xcub_moveit_test_controller/launch/test_controller.launch.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ def generate_launch_description():
1919

2020
moveit_config = MoveItConfigsBuilder(robot_name).to_moveit_configs()
2121

22-
test_controller_node = Node(
23-
name="test_controller",
24-
package="test_controller",
25-
executable="test_controller",
22+
xcub_test_controller_node = Node(
23+
name="xcub_moveit_test_controller",
24+
package="xcub_moveit_test_controller",
25+
executable="xcub_moveit_test_controller",
2626
output="screen",
2727
parameters=[
2828
moveit_config.robot_description,
@@ -33,5 +33,5 @@ def generate_launch_description():
3333
)
3434

3535
return LaunchDescription([
36-
test_controller_node
36+
xcub_test_controller_node
3737
])

0 commit comments

Comments
 (0)