-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Kinova JACO + MICO definitions to robot (#32)
* Added Kinova JACO + MICO robot definition * Match moveit groups to https://github.com/Kinovarobotics/kinova-ros/tree/noetic-devel/kinova_moveit * Include gripper type and assistive/service designation in kinova prefix * Added pre-commit hooks
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from typing import List | ||
|
||
# Documentation: | ||
# https://github.com/Kinovarobotics/kinova-ros/ | ||
|
||
MOVE_GROUP_ARM: str = "arm" | ||
MOVE_GROUP_GRIPPER: str = "gripper" | ||
|
||
JACO_PREFIX: str = "j2" | ||
MICO_PREFIX: str = "m1" | ||
|
||
|
||
def get_prefix( | ||
version_prefix: str = JACO_PREFIX, | ||
arm_dof: int = 6, | ||
hand_dof: int = 2, | ||
spherical=False, | ||
assistive=False, | ||
) -> str: | ||
return ( | ||
version_prefix | ||
+ ("s" if spherical else "n") | ||
+ str(arm_dof) | ||
+ ("a" if assistive else "s") | ||
+ str(hand_dof) | ||
+ "00_" | ||
) | ||
|
||
|
||
def joint_names(prefix: str = get_prefix()) -> List[str]: | ||
res = [] | ||
arm_dof = int(prefix[3]) | ||
for i in range(arm_dof): | ||
res.append(prefix + "joint_" + str(i + 1)) | ||
return res | ||
|
||
|
||
def base_link_name(prefix: str = get_prefix()) -> str: | ||
return prefix + "link_base" | ||
|
||
|
||
def end_effector_name(prefix: str = get_prefix()) -> str: | ||
return prefix + "end_effector" | ||
|
||
|
||
def gripper_joint_names(prefix: str = get_prefix()) -> List[str]: | ||
res = [] | ||
hand_dof = int(prefix[5]) | ||
for i in range(hand_dof): | ||
res.append(prefix + "joint_finger_" + str(i + 1)) | ||
return res |