Skip to content

Commit

Permalink
Require scenepk argument
Browse files Browse the repository at this point in the history
  • Loading branch information
felixvd committed Jan 17, 2023
1 parent 441cf01 commit cbecc69
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.1.2 (2023-01-13)

- Bugfix: Require `scenepk` argument in `GetSceneSensorMapping` and `SetSceneSensorMapping`


# 0.1.1 (2023-01-11)

- Update GraphQL client.
Expand Down
4 changes: 4 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 0.1.2 (Bugfix for migration)

The `scenepk` argument in `GetSceneSensorMapping` and `SetSceneSensorMapping` is required now.

# 0.1.0 (Migrating from mujincontrollerclientpy)

The package `mujincontrollerclient` was split into `mujinwebstackclient` and `mujinplanningclient`. To migrate, determine which methods are used by your controllerclient instance, and convert to the correct class from either package (or use both).
Expand Down
2 changes: 1 addition & 1 deletion python/mujinwebstackclient/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '0.1.1'
__version__ = '0.1.2'

# Do not forget to update CHANGELOG.md
8 changes: 2 additions & 6 deletions python/mujinwebstackclient/webstackclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,9 @@ def GetObjectGeometry(self, objectpk, timeout=5):
# Sensor mappings related
#

def GetSceneSensorMapping(self, scenepk=None, timeout=5):
def GetSceneSensorMapping(self, scenepk, timeout=5):
"""Return the mapping of camerafullname to cameraid. e.g. {'sourcecamera/ensenso_l_rectified': '150353', 'sourcecamera/ensenso_r_rectified':'150353_Right' ...}
"""
if scenepk is None:
scenepk = self.scenepk
instobjects = self._webclient.APICall('GET', u'scene/%s/instobject/' % scenepk, fields='attachedsensors,connectedBodies,object_pk,name', params={'limit': 0}, timeout=timeout)['objects']
sensormapping = {}
for instobject in instobjects:
Expand Down Expand Up @@ -722,12 +720,10 @@ def GetSceneSensorMapping(self, scenepk=None, timeout=5):
log.warn('attached sensor %s does not have hardware_id', camerafullname)
return sensormapping

def SetSceneSensorMapping(self, sensormapping, scenepk=None, timeout=5):
def SetSceneSensorMapping(self, sensormapping, scenepk, timeout=5):
"""
:param sensormapping: The mapping of camerafullname to cameraid. e.g. {'sourcecamera/ensenso_l_rectified': '150353', 'sourcecamera/ensenso_r_rectified':'150353_Right' ...}
"""
if scenepk is None:
scenepk = self.scenepk
instobjects = self._webclient.APICall('GET', u'scene/%s/instobject/' % scenepk, params={'limit': 0}, fields='attachedsensors,connectedBodies,object_pk,name', timeout=timeout)['objects']
cameracontainernames = set([camerafullname.split('/', 1)[0] for camerafullname in sensormapping.keys()])
sensormapping = dict(sensormapping)
Expand Down

0 comments on commit cbecc69

Please sign in to comment.