Skip to content

Commit

Permalink
[hironx_ros_bridge] Simplify CollisionDetector disabling specific to …
Browse files Browse the repository at this point in the history
…HIRONX
  • Loading branch information
pazeshun committed Nov 24, 2019
1 parent 2d163fd commit 432b9d3
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions hironx_ros_bridge/src/hironx_ros_bridge/hironx_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,20 +474,18 @@ def getRTCList(self):

# Specific code to current HIRONX status:
## CollisionDetector.enable is not set in normal conf, but we must remove CollisionDetector
if self.ms and self.ms.ref and len(self.ms.ref.get_component_profiles()) > 0:
co_rtc = ['co', "CollisionDetector"]
if co_rtc not in rtclist:
pass
elif self.ms and self.ms.ref and len(self.ms.ref.get_component_profiles()) > 0:
try:
enable = next(p for p
in self.ms.ref.get_component_profiles()[0].properties
if p.name == 'CollisionDetector.enable').value.value()
next(p for p
in self.ms.ref.get_component_profiles()[0].properties
if p.name == (co_rtc[1] + '.enable')).value.value()
except StopIteration:
enable = 'NO'
if enable == 'NO':
try:
rtclist.remove(['co', "CollisionDetector"])
except ValueError: # list.remove(x): x not in list
pass
rtclist.remove(co_rtc)
else:
rtclist.remove(['co', "CollisionDetector"])
rtclist.remove(co_rtc)

if hasattr(self, 'rmfo'):
self.ms.load("RemoveForceSensorLinkOffset")
Expand Down

0 comments on commit 432b9d3

Please sign in to comment.