From a82d4ceda74aedcaae24594ec16c7dc9303efcb7 Mon Sep 17 00:00:00 2001 From: Binit Shah Date: Fri, 15 Sep 2023 02:22:53 -0400 Subject: [PATCH] HelloNode utility method to read joint state --- hello_helpers/src/hello_helpers/hello_misc.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hello_helpers/src/hello_helpers/hello_misc.py b/hello_helpers/src/hello_helpers/hello_misc.py index 1f764aa..b556cca 100644 --- a/hello_helpers/src/hello_helpers/hello_misc.py +++ b/hello_helpers/src/hello_helpers/hello_misc.py @@ -178,6 +178,13 @@ class HelloNode: assert(self._point_cloud is not None) return self._point_cloud + def get_joint_state(self, joint_name): + i = self._joint_states.name.index(joint_name) + joint_position = self._joint_states.position[i] + joint_velocity = self._joint_states.velocity[i] + joint_effort = self._joint_states.effort[i] + return (joint_position, joint_velocity, joint_effort) + def home_the_robot(self): if self.dryrun: return