Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KincoActuatorIsaacLab
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kevin
KincoActuatorIsaacLab
Commits
a972182b
Commit
a972182b
authored
Oct 11, 2024
by
Mayank Mittal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes formatting issues in the robot loading benchmark script
parent
92dcb8c0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
benchmark_load_robot.py
source/standalone/benchmarks/benchmark_load_robot.py
+8
-11
No files found.
source/standalone/benchmarks/benchmark_load_robot.py
View file @
a972182b
...
...
@@ -24,7 +24,7 @@ parser.add_argument("--num_envs", type=int, default=32, help="Number of robots t
parser
.
add_argument
(
"--robot"
,
type
=
str
,
choices
=
[
'anymal_d'
,
'h1'
,
'g1'
],
choices
=
[
"anymal_d"
,
"h1"
,
"g1"
],
default
=
"h1"
,
help
=
"Choose which robot to load: anymal_d, h1, or g1."
,
)
...
...
@@ -69,6 +69,7 @@ imports_time_end = time.perf_counter_ns()
print
(
f
"[INFO]: Imports time: {(imports_time_end - imports_time_begin) / 1e6:.2f} ms"
)
@
configclass
class
RobotSceneCfg
(
InteractiveSceneCfg
):
"""Configuration for a simple scene with a robot."""
...
...
@@ -91,6 +92,7 @@ class RobotSceneCfg(InteractiveSceneCfg):
else
:
raise
ValueError
(
f
"Unsupported robot type: {args_cli.robot}."
)
def
run_simulator
(
sim
:
sim_utils
.
SimulationContext
,
scene
:
InteractiveScene
):
"""Runs the simulation loop."""
# Extract scene entities
...
...
@@ -98,18 +100,15 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
robot
=
scene
[
"robot"
]
# Define simulation stepping
sim_dt
=
sim
.
get_physics_dt
()
count
=
0
# Start the timer for creating the scene
step_time_begin
=
time
.
perf_counter_ns
()
num_steps
=
2000
# Simulation loop
for
_
in
range
(
num_steps
):
for
count
in
range
(
num_steps
):
# Reset
if
count
%
500
==
0
:
# reset counter
count
=
0
# reset the scene entities
# root state
# we offset the root state by the origin since the states are written in simulation world frame
...
...
@@ -132,8 +131,6 @@ def run_simulator(sim: sim_utils.SimulationContext, scene: InteractiveScene):
scene
.
write_data_to_sim
()
# Perform step
sim
.
step
()
# Increment counter
count
+=
1
# Update buffers
scene
.
update
(
sim_dt
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment