Skip to content

Commit

Permalink
Added actuator_names and camera_names as properties. (#27)
Browse files Browse the repository at this point in the history
* Expose actuator names in the MjModel class.

* Added camera_names as property.
  • Loading branch information
bmcgrew authored Jan 25, 2017
1 parent 87ab883 commit 6d56181
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions mujoco_py/mjcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ def numeric_names(self):
return [ctypes.string_at(start_addr + int(inc))
for inc in self.name_numericadr.flatten()]

@property
def actuator_names(self):
start_addr = ctypes.addressof(self.names.contents)
return [ctypes.string_at(start_addr + int(inc))
for inc in self.name_actuatoradr.flatten()]

@property
def camera_names(self):
start_addr = ctypes.addressof(self.names.contents)
return [ctypes.string_at(start_addr + int(inc))
for inc in self.name_camadr.flatten()]


class MjData(MjDataWrapper):

Expand Down

0 comments on commit 6d56181

Please sign in to comment.