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
bd64177c
Commit
bd64177c
authored
Jul 06, 2023
by
Mayank Mittal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes buffer call for raycast sensor
parent
7a76da7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
ray_caster.py
...c.orbit/omni/isaac/orbit/sensors/ray_caster/ray_caster.py
+2
-2
test_ray_caster.py
...tensions/omni.isaac.orbit/test/sensors/test_ray_caster.py
+9
-4
No files found.
source/extensions/omni.isaac.orbit/omni/isaac/orbit/sensors/ray_caster/ray_caster.py
View file @
bd64177c
...
...
@@ -194,9 +194,9 @@ class RayCaster(SensorBase):
"""Fills the buffers of the sensor data."""
# default to all sensors
if
env_ids
is
None
:
env_ids
=
...
env_ids
=
self
.
_ALL_INDICES
# obtain the poses of the sensors
pos_w
,
quat_w
=
self
.
_view
.
get_world_poses
(
clone
=
False
)
pos_w
,
quat_w
=
self
.
_view
.
get_world_poses
(
env_ids
,
clone
=
False
)
self
.
_data
.
pos_w
[
env_ids
]
=
pos_w
self
.
_data
.
quat_w
[
env_ids
]
=
quat_w
...
...
source/extensions/omni.isaac.orbit/test/sensors/test_ray_caster.py
View file @
bd64177c
...
...
@@ -39,6 +39,7 @@ simulation_app = SimulationApp(config)
import
numpy
as
np
import
torch
import
omni.isaac.core.utils.prims
as
prim_utils
from
omni.isaac.cloner
import
GridCloner
...
...
@@ -145,7 +146,7 @@ def main():
print
(
ray_caster
)
# Get the initial positions of the balls
ball_initial_pos
e
s
=
ball_view
.
get_world_poses
()
ball_initial_pos
itions
,
ball_initial_orientation
s
=
ball_view
.
get_world_poses
()
ball_initial_velocities
=
ball_view
.
get_velocities
()
# Create a counter for resetting the scene
...
...
@@ -161,11 +162,15 @@ def main():
continue
# Reset the scene
if
step_count
%
500
==
0
:
# sample random indices to reset
reset_indices
=
torch
.
randint
(
0
,
num_envs
,
(
num_envs
//
2
,))
# reset the balls
ball_view
.
set_world_poses
(
*
ball_initial_poses
)
ball_view
.
set_velocities
(
ball_initial_velocities
)
ball_view
.
set_world_poses
(
ball_initial_positions
[
reset_indices
],
ball_initial_orientations
[
reset_indices
],
indices
=
reset_indices
)
ball_view
.
set_velocities
(
ball_initial_velocities
[
reset_indices
],
indices
=
reset_indices
)
# reset the sensor
ray_caster
.
reset_buffers
()
ray_caster
.
reset_buffers
(
reset_indices
)
# reset the counter
step_count
=
0
# Step simulation
...
...
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