Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add rostest for vive controller #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HiroIshida
Copy link
Owner

@HiroIshida HiroIshida commented Aug 4, 2022

diff --git a/mohou_ros_utils/vive_controller/robot_interface.py b/mohou_ros_utils/vive_controller/robot_interface.py
index 9531300..458d724 100644
--- a/mohou_ros_utils/vive_controller/robot_interface.py
+++ b/mohou_ros_utils/vive_controller/robot_interface.py
@@ -49,7 +49,7 @@ class RobotControllerBase(ABC):
     def solve_inverse_kinematics(self, tf_gripper2base_target: CoordinateTransform) -> bool:
         joints = [self.robot_model.__dict__[jname] for jname in self.control_joint_names]
         link_list = [joint.child_link for joint in joints]
-        end_effector = [ln for ln in link_list if ln.name == self.end_effector_name].pop()
+        end_effector = [ln for ln in self.robot_model.link_list if ln.name == self.end_effector_name].pop()
         assert isinstance(end_effector, Link)
         av_next = self.robot_model.inverse_kinematics(
             tf_gripper2base_target.to_skrobot_coords(), end_effector, link_list, stop=5
diff --git a/scripts/baxter/vive_controll_baxter.py b/scripts/baxter/vive_controll_baxter.py
index 12e9273..1bdbd28 100755
--- a/scripts/baxter/vive_controll_baxter.py
+++ b/scripts/baxter/vive_controll_baxter.py
@@ -48,8 +48,8 @@ if __name__ == "__main__":
     rarm_con = SkrobotBaxteRarmController(robot_model)
     larm_con = SkrobotBaxterLarmController(robot_model)
 
-    rarm_vive_con = RarmViveController(rarm_con, controller_ids[0], scale, config)
-    larm_vive_con = LarmViveController(larm_con, controller_ids[1], scale, config)
+    rarm_vive_con = RarmViveController(rarm_con, controller_ids[0], scale, config, "head_nod")
+    larm_vive_con = LarmViveController(larm_con, controller_ids[1], scale, config, "head_nod")
     rarm_vive_con.start()
     larm_vive_con.start()
     rospy.spin()

@HiroIshida HiroIshida force-pushed the master branch 2 times, most recently from 4c4c0d8 to 8b88d94 Compare August 7, 2022 04:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant