-
Notifications
You must be signed in to change notification settings - Fork 11
[I] Using custom parameters
The controller node consists of different modules and each module has a set of parameters. The modules are:
- module_base_controller: for the youbot base
- module_gripper: for the gripper
- module_interpolation: for interpolated movements and arm velocity commands
- module_joint_trajectory: for arm trajectory commands
- module_motion_planner: for graph based trajectory planning
- module_direct_control: for direct position commands
- module_gravity_compensation: for gravity compensation and force fitting
###Default Parameters
The default parameters are stored in config files (named params.yaml) in the directory luh_youbot_controller/cfg. For example the parameters for the motion planner module can be found in luh_youbot_controller/cfg/module_motion_planner/params.yaml. The file looks like this:
# files
poses_file: cfg/module_motion_planner/poses.yaml
neighbors_file: cfg/module_motion_planner/neighbors.yaml
# influence factors for weights in the graph
euclidean_influence_factor: 1.0
constant_influence: 0.1
q1_extra_weight: 0.0
# velocity control
velocity_factor: 1.0
# command mode = {POSITION, VELOCITY, TORQUE}
command_mode: POSITION
goal_tolerance: 20 #degrees
tolerance_check_percentage: 0.9
finepos_pos_tolerance: 0.3 #degrees
finepos_vel_tolerance: 0.1 #degrees per second
You can use these files to see what parameters are available and what the default values are. It is not recommended however to change the values directly in these files! Changes in these files affect all applications on the Youbot. The next section will show you how to change parameters only for your own project.
###Changing Parameters
Parameters can be defined in a launch file. If you look at the controller.launch file you will see that it does four things:
- load default parameters of driver
- load default parameters of controller modules
- launch robot state publisher
- launch controller node
(file: luh_youbot_controller/launch/controller.launch)
<?xml version="1.0"?>
<launch>
<arg name="youBotHasBase" default="true"/>
<arg name="youBotHasArm" default="true"/>
<!-- LOAD DEFAULT DRIVER PARAMETERS -->
<include file="$(find luh_youbot_driver_api)/launch/load_default_parameters.launch">
<arg name="youBotHasArm" value="$(arg youBotHasArm)"/>
<arg name="youBotHasBase" value="$(arg youBotHasBase)"/>
</include>
<!-- LOAD DEFAULT CONTROLLER PARAMETERS -->
<include file="$(find luh_youbot_controller)/launch/load_default_parameters.launch" />
<!-- LAUNCH STATE PUBLISHER -->
<include file="$(find luh_youbot_controller)/launch/youbot_state_publisher.launch">
<arg name="youBotHasArm" value="$(arg youBotHasArm)"/>
<arg name="youBotHasBase" value="$(arg youBotHasBase)"/>
</include>
<!-- LAUNCH CONTROLLER NODE -->
<node name="controller_node" pkg="luh_youbot_controller" type="controller_node" output="screen" />
</launch>
f you want to use your own parameters you can just copy the above lines to your own launchfile and define the parameters there. You can first load the default values and then overwrite the parameters you want to change before you start the node:
(file: your_pkg/launch/your_file.launch)
<?xml version="1.0"?>
<launch>
<arg name="youBotHasBase" default="true"/>
<arg name="youBotHasArm" default="true"/>
<!-- LOAD DEFAULT DRIVER PARAMETERS -->
<include file="$(find luh_youbot_driver_api)/launch/load_default_parameters.launch">
<arg name="youBotHasArm" value="$(arg youBotHasArm)"/>
<arg name="youBotHasBase" value="$(arg youBotHasBase)"/>
</include>
<!-- LOAD DEFAULT CONTROLLER PARAMETERS -->
<include file="$(find luh_youbot_controller)/launch/load_default_parameters.launch" />
<!-- ADD YOUR CUSTOM PARAMETERS HERE -->
<param name="module_motion_planner/goal_tolerance" value="10"/>
<param name="module_motion_planner/velocity_factor" value="0.5"/>
<!-- LAUNCH STATE PUBLISHER -->
<include file="$(find luh_youbot_controller)/launch/youbot_state_publisher.launch">
<arg name="youBotHasArm" value="$(arg youBotHasArm)"/>
<arg name="youBotHasBase" value="$(arg youBotHasBase)"/>
</include>
<!-- LAUNCH CONTROLLER NODE -->
<node name="controller_node" pkg="luh_youbot_controller" type="controller_node" output="screen" />
</launch>