Skip to content

Commit

Permalink
fix string filter for cpp and add new test cases to yaml
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
  • Loading branch information
pac48 committed Feb 25, 2024
1 parent fa2157d commit 6ea401f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
24 changes: 24 additions & 0 deletions example/src/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,27 @@ admittance_controller:
one_of<>: [ [ 0, 1, 2, -1 ] ],
},
}
angle_wraparound: {
type: bool,
default_value: false,
description: 'For joints that wrap around (without end stop, ie. are continuous),
where the shortest rotation to the target position is the desired motion.
If true, the position error :math:`e = normalize(s_d - s)` is normalized between :math:`-\pi, \pi`.
Otherwise :math:`e = s_d - s` is used, with the desired position :math:`s_d` and the measured
position :math:`s` from the state interface.'
}
open_loop_control: {
type: bool,
default_value: false,
description: "Use controller in open-loop control mode
\n\n
* The controller ignores the states provided by hardware interface but using last commands as states for starting the trajectory interpolation.\n
* It deactivates the feedback control, see the ``gains`` structure.
\n\n
This is useful if hardware states are not following commands, i.e., an offset between those (typical for hydraulic manipulators).
\n\n
If this flag is set, the controller tries to read the values from the command interfaces on activation.
If they have real numeric values, those will be used instead of state interfaces.
Therefore it is important set command interfaces to NaN (i.e., ``std::numeric_limits<double>::quiet_NaN()``) or state values when the hardware is started.\n",
read_only: true,
}
24 changes: 24 additions & 0 deletions example_python/generate_parameter_module_example/parameters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,27 @@ admittance_controller:
one_of<>: [ [ 0, 1, 2, -1 ] ],
},
}
angle_wraparound: {
type: bool,
default_value: false,
description: 'For joints that wrap around (without end stop, ie. are continuous),
where the shortest rotation to the target position is the desired motion.
If true, the position error :math:`e = normalize(s_d - s)` is normalized between :math:`-\pi, \pi`.
Otherwise :math:`e = s_d - s` is used, with the desired position :math:`s_d` and the measured
position :math:`s` from the state interface.'
}
open_loop_control: {
type: bool,
default_value: false,
description: "Use controller in open-loop control mode
\n\n
* The controller ignores the states provided by hardware interface but using last commands as states for starting the trajectory interpolation.\n
* It deactivates the feedback control, see the ``gains`` structure.
\n\n
This is useful if hardware states are not following commands, i.e., an offset between those (typical for hydraulic manipulators).
\n\n
If this flag is set, the controller tries to read the values from the command interfaces on activation.
If they have real numeric values, those will be used instead of state interfaces.
Therefore it is important set command interfaces to NaN (i.e., ``std::numeric_limits<double>::quiet_NaN()``) or state values when the hardware is started.\n",
read_only: true,
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ def valid_string_cpp(description):
str: The filtered string that is a valid C++ string.
"""
if description:
filtered_description = description.replace('\n', '\\n ')
# remove possible markdown/rst syntax, but add proper indent for cpp-header files.
filtered_description = (
description.replace('\\', '\\\\').replace('`', '').replace('\n', '\\n ')
)
return f'"{filtered_description}"'
else:
return '""'
Expand Down

0 comments on commit 6ea401f

Please # to comment.