Add mj_maxContact API function.

PiperOrigin-RevId: 903135055
Change-Id: I5f103c7d51f97e327c923bc567002ace835f5517
This commit is contained in:
Kyle Bayes
2026-04-21 04:02:34 -07:00
committed by Copybara-Service
parent bc5883e82f
commit 3325971840
13 changed files with 448 additions and 21 deletions
+1
View File
@@ -304,6 +304,7 @@ PYBIND11_MODULE(_functions, pymodule) {
m, d, flg_acc, result.data());
});
Def<traits::mj_rnePostConstraint>(pymodule);
Def<traits::mj_maxContact>(pymodule);
Def<traits::mj_collision>(pymodule);
Def<traits::mj_makeConstraint>(pymodule);
Def<traits::mj_island>(pymodule);
+26
View File
@@ -2407,6 +2407,32 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
doc='RNE with complete data: compute cacc, cfrc_ext, cfrc_int.',
)),
('mj_maxContact',
FunctionDecl(
name='mj_maxContact',
return_type=ValueType(name='int'),
parameters=(
FunctionParameterDecl(
name='m',
type=PointerType(
inner_type=ValueType(name='mjModel', is_const=True),
),
),
FunctionParameterDecl(
name='g1',
type=ValueType(name='int'),
),
FunctionParameterDecl(
name='g2',
type=ValueType(name='int'),
),
FunctionParameterDecl(
name='has_margin',
type=ValueType(name='int'),
),
),
doc='Return the maximum number of contacts that can be generated between two geoms. If has_margin is -1, then the margin is pulled from the model, otherwise if has_margin > 0 indicates that the geoms have a positive margin.', # pylint: disable=line-too-long
)),
('mj_collision',
FunctionDecl(
name='mj_collision',