Since planner and control servers are implemented with the use of actions in navigation2, you can specify the planner_id or controller_id to specify a particular one in run time by specifying related fields in action definition.
for instance you will see a planner_id field, fill that programmatically on run time.
#goal definition
geometry_msgs/PoseStamped goal
geometry_msgs/PoseStamped start
string planner_id
bool use_start # If true, use current robot pose as path start, if false, use start above instead
---
#result definition
nav_msgs/Path path
builtin_interfaces/Duration planning_time
---
#feedback
Take a look at how to configure planners here, you will need to append the array of strings that refers to names of planner plugins
planner_server:
ros__parameters:
expected_planner_frequency: 20.0
planner_plugins: ['GridBased1', 'GridBased2']
GridBased1:
plugin: 'nav2_navfn_planner/NavfnPlanner'
GridBased2:
plugin: 'some_planner/SomePlanner'
Then in the action call you would specify planner_id as one of ['GridBased1', 'GridBased2']
same should apply to the controllers.