Functions for printing the contents of mjvScene.

PiperOrigin-RevId: 812699642
Change-Id: Iafff53c952c952624129ff01a8c1b0aa5d38eec5
This commit is contained in:
Haroon Qureshi
2025-09-29 02:44:55 -07:00
committed by Copybara-Service
parent e1c7e19780
commit 6a7566872a
8 changed files with 380 additions and 104 deletions
+2
View File
@@ -174,6 +174,8 @@ PYBIND11_MODULE(_functions, pymodule) {
Def<traits::mj_printModel>(pymodule);
Def<traits::mj_printFormattedData>(pymodule);
Def<traits::mj_printData>(pymodule);
Def<traits::mj_printFormattedScene>(pymodule);
Def<traits::mj_printScene>(pymodule);
DEF_WITH_OMITTED_PY_ARGS(traits::mju_printMat, "nr", "nc")(
pymodule,
[](Eigen::Ref<const EigenArrayXX> mat) {
+47 -1
View File
@@ -1274,7 +1274,7 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
),
),
doc='Print mjData to text file, specifying format. float_format must be a valid printf-style format string for a single float value', # pylint: disable=line-too-long
doc='Print mjData to text file, specifying format. float_format must be a valid printf-style format string for a single float value.', # pylint: disable=line-too-long
)),
('mj_printData',
FunctionDecl(
@@ -1392,6 +1392,52 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
doc='Print internal XML schema as plain text or HTML, with style-padding or &nbsp;.', # pylint: disable=line-too-long
)),
('mj_printScene',
FunctionDecl(
name='mj_printScene',
return_type=ValueType(name='void'),
parameters=(
FunctionParameterDecl(
name='s',
type=PointerType(
inner_type=ValueType(name='mjvScene', is_const=True),
),
),
FunctionParameterDecl(
name='filename',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Print scene to text file.',
)),
('mj_printFormattedScene',
FunctionDecl(
name='mj_printFormattedScene',
return_type=ValueType(name='void'),
parameters=(
FunctionParameterDecl(
name='s',
type=PointerType(
inner_type=ValueType(name='mjvScene', is_const=True),
),
),
FunctionParameterDecl(
name='filename',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
FunctionParameterDecl(
name='float_format',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Print scene to text file, specifying format. float_format must be a valid printf-style format string for a single float value.', # pylint: disable=line-too-long
)),
('mj_fwdPosition',
FunctionDecl(
name='mj_fwdPosition',