Removing unused packages¶
The crs-ros framework consists of a large amount of packages supporting different estimator / controller and model dynamics.
Packages marked as optional can be excluded from being built by removing them from the package.xml file and/or erasing them from disk.
Skiplisting unused packages:¶
Unused packages can be marked as "skiplisted" and will not be built when executing crs build. The following examples shows how the exclude the kinematic model and its dependency from being built:
Example¶
Command¶
Output¶
-------------------------------------------------------------------
Profile: default
Extending: [explicit] /opt/ros/noetic
Workspace: /code
-------------------------------------------------------------------
Build Space: [exists] /code/build
Devel Space: [exists] /code/devel
Install Space: [unused] /code/install
Log Space: [exists] /code/logs
Source Space: [exists] /code/src
DESTDIR: [unused] None
-------------------------------------------------------------------
Devel Space Layout: merged
Install Space Layout: None
-------------------------------------------------------------------
Additional CMake Args: -DCMAKE_BUILD_TYPE=RelWithDebInfo
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
-------------------------------------------------------------------
Buildlisted Packages: None
>> Skiplisted Packages: kinematic_model kinematic_sensor_model <<
-------------------------------------------------------------------
Workspace configuration appears valid.
catkin build or crs build will not build the skiplisted packages anymore.
Alternatively, the dependencies can be removed from the package.xml and the corresponding folders of the packages can be removed:
Example¶
Assuming you already now that you will be using the pacejka_model in combination with a mpc_controller and a Extended Kalman Filter. In order to only compile the relevant packages, the following changes to the package.xml files needs to be made:
Package.xml Changes¶
src/ros/ros_simulator/package.xml¶
<!-- Optional Dependencies -->
<depend>pacejka_model</depend>
<depend>pacejka_sensor_model</depend>
- <depend>kinematic_model</depend>
- <depend>kinematic_sensor_model</depend>
src/ros/ros_estimators/package.xml¶
<!-- Optional Dependencies -->
<depend>pacejka_model</depend>
<depend>pacejka_sensor_model</depend>
- <depend>kinematic_sensor_model</depend>
- <depend>kinematic_model</depend>
- <depend>pacejka_sensor_model</depend>
- <depend>lowpass_estimator</depend>
src/ros/ros_simulator/package.xml¶
<!-- Optional Dependencies -->
<depend>pacejka_model</depend>
<depend>pacejka_sensor_model</depend>
- <depend>kinematic_model</depend>
- <depend>kinematic_sensor_model</depend>
src/ros/ros_crs_utils/package.xml¶
<!-- Optional Dependencies -->
<depend>lowpass_estimator</depend>
<depend>pacejka_sensor_model</depend>
- <depend>kinematic_model</depend>
- <depend>kinematic_sensor_model</depend>
- <depend>pid_controller</depend>
- <depend>ff_fb_controller</depend>
src/ros/ros_controllers/package.xml¶
<!-- Optional Dependencies -->
- <depend>pid_controller</depend>
- <depend>ff_fb_controller</depend>
<depend>mpc_controller</depend>
Building¶
Once the package dependencies have been removed from the ´package.xml´, the desired components can be built using the catkin build command:
Which gives the following output (Note that only 18 of the 30 packages have been built):[build] Found '30' packages in 0.0 seconds.
[build] Updating package table.
Starting >>> catkin_simple
Starting >>> crs_msgs
Finished <<< catkin_simple [ 1.4 seconds ]
Starting >>> controls
Starting >>> eigen_catkin
Starting >>> yaml_cpp_catkin
Finished <<< crs_msgs [ 3.1 seconds ]
Finished <<< eigen_catkin [ 2.3 seconds ]
Starting >>> commons
Starting >>> dynamic_models
Starting >>> sensor_models
Finished <<< controls [ 2.4 seconds ]
Finished <<< sensor_models [ 1.6 seconds ]
Finished <<< dynamic_models [ 1.6 seconds ]
Finished <<< commons [ 3.3 seconds ]
Finished <<< yaml_cpp_catkin [ 23.6 seconds ]
Starting >>> pacejka_model
Finished <<< pacejka_model [ 9.2 seconds ]
Starting >>> mpc_solvers
Starting >>> pacejka_sensor_model
Finished <<< mpc_solvers [ 2.7 seconds ]
Starting >>> acados_pacejka_mpcc_solver
Finished <<< acados_pacejka_mpcc_solver [ 5.8 seconds ]
Starting >>> mpc_controller
Finished <<< pacejka_sensor_model [ 9.2 seconds ]
Starting >>> kalman_estimator
Finished <<< kalman_estimator [ 2.6 seconds ]
Finished <<< mpc_controller [ 7.5 seconds ]
Starting >>> ros_crs_utils
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Warnings << ros_crs_utils :cmake /code/logs/ros_crs_utils/build.cmake.000.log
Lowpass Estimator not found. Building without Lowpass Estimator support
PID Controller not found. Building without PID controller support
FF FB Controller not found. Building without FF FB controller support
Kinematic Model not found. Building without kinematic model support
....................................................................................................................................................................................................................................
Finished <<< ros_crs_utils [ 8.5 seconds ]
Starting >>> ros_controllers
Starting >>> ros_estimators
Starting >>> ros_simulator
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Warnings << "ros_estimators:cmake /code/logs/ros_estimators/build.cmake.000.log
Kinematic Model not found. Building without kinematic model support
Lowpass Estimator not found. Building without Lowpass Estimator support" -
....................................................................................................................................................................................................................................
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Warnings << ros_controllers:cmake /code/logs/ros_controllers/build.cmake.000.log
PID Controller not found. Building without PID Controller support
FF FB Controller not found. Building without FF FB Controller support
....................................................................................................................................................................................................................................
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Warnings << ros_simulator:cmake /code/logs/ros_simulator/build.cmake.000.log
Kinematic Model not found. Building without kinematic model support
....................................................................................................................................................................................................................................
____________________________________________________________________________________________________________________________________________________________________________________________________________________________________
Finished <<< ros_controllers [ 23.4 seconds ]
Finished <<< ros_simulator [ 31.3 seconds ]
Finished <<< ros_estimators [ 32.9 seconds ]
[build] Summary: All 18 packages succeeded!
[build] Ignored: 12 packages were skipped or are skiplisted.
[build] Warnings: None.
[build] Abandoned: None.
[build] Failed: None.
[build] Runtime: 34.9 seconds total.