Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Simox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
Simox
Commits
7d7f348f
Commit
7d7f348f
authored
6 years ago
by
Rainer Kartmann
Browse files
Options
Downloads
Patches
Plain Diff
Added option for actuator suffix
parent
3ac7b21b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
VirtualRobot/examples/Simox2Mjcf/main.cpp
+10
-1
10 additions, 1 deletion
VirtualRobot/examples/Simox2Mjcf/main.cpp
with
10 additions
and
1 deletion
VirtualRobot/examples/Simox2Mjcf/main.cpp
+
10
−
1
View file @
7d7f348f
...
...
@@ -19,7 +19,7 @@ namespace fs = boost::filesystem;
*/
int
main
(
int
argc
,
char
*
argv
[])
{
RuntimeEnvironment
::
setCaption
(
"Convert Simox XML to MJCF (Mujoco XML)
.
"
);
RuntimeEnvironment
::
setCaption
(
"Convert Simox XML to MJCF (Mujoco XML)"
);
RuntimeEnvironment
::
considerKey
(
"robot"
,
"The Simox robot model to convert. (required)"
);
...
...
@@ -31,12 +31,17 @@ int main(int argc, char* argv[])
"actuator"
,
"The actuator type to add (motor, position, velocity). (default: motor)"
);
RuntimeEnvironment
::
considerFlag
(
"mocap"
,
"Add a mocap body to which the robot root body is welded."
);
RuntimeEnvironment
::
considerKey
(
"scale_length"
,
"Scaling of lengths and distances (to m). For meshes, see 'scale_mesh'. (default: 1.0)"
);
RuntimeEnvironment
::
considerKey
(
"scale_mesh"
,
"Scaling of meshes (to m). (default: 1.0)"
);
RuntimeEnvironment
::
considerKey
(
"scale_mass"
,
"Scaling of masses (to kg). (default: 1.0)"
);
RuntimeEnvironment
::
considerFlag
(
"actuator_suffix"
,
"Add a type suffix to actuator names."
);
RuntimeEnvironment
::
considerFlag
(
"verbose"
,
"Enable verbose output."
);
...
...
@@ -83,6 +88,7 @@ int main(int argc, char* argv[])
const
bool
mocap
=
RuntimeEnvironment
::
hasFlag
(
"mocap"
);
const
bool
verbose
=
RuntimeEnvironment
::
hasFlag
(
"verbose"
);
const
bool
addActuatorSuffix
=
RuntimeEnvironment
::
hasFlag
(
"actuator_suffix"
);
auto
parseFloatParameter
=
[](
const
std
::
string
&
key
,
const
std
::
string
&
default_
)
{
...
...
@@ -148,12 +154,15 @@ int main(int argc, char* argv[])
{
// direct API
mujoco
::
MujocoIO
mujocoIO
(
robot
);
mujocoIO
.
setActuatorType
(
actuatorType
);
mujocoIO
.
setWithMocapBody
(
mocap
);
mujocoIO
.
setLengthScale
(
scaleLength
);
mujocoIO
.
setMeshScale
(
scaleMesh
);
mujocoIO
.
setMassScale
(
scaleMass
);
mujocoIO
.
setVerbose
(
verbose
);
mujocoIO
.
setAddActuatorTypeSuffix
(
addActuatorSuffix
);
mujocoIO
.
saveMJCF
(
inputFilename
.
filename
().
string
(),
outputDir
.
string
(),
meshRelDir
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment