initial commit

This commit is contained in:
Ilya Uraev 2025-06-03 15:39:15 +03:00
commit 1ef9d67af2
5 changed files with 203 additions and 0 deletions

31
CMakeLists.txt Normal file
View file

@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.8)
project(simple_gz_gripper)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# find dependencies
find_package(ament_cmake REQUIRED)
# uncomment the following section in order to fill in
# further dependencies manually.
# find_package(<dependency> REQUIRED)
install(
DIRECTORY config urdf
DESTINATION share/${PROJECT_NAME}/
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# comment the line when a copyright and license is added to all source files
set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# comment the line when this package is in a git repo and when
# a copyright and license is added to all source files
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()
ament_package()

0
README.md Normal file
View file

18
package.xml Normal file
View file

@ -0,0 +1,18 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>simple_gz_gripper</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="ur.narmak@gmail.com">narenmak</maintainer>
<license>TODO: License declaration</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="simple_gz_gripper_ros2_control" params="prefix">
<ros2_control name="GazeboSystem" type="system">
<hardware>
<plugin>gz_ros2_control/GazeboSimSystem</plugin>
</hardware>
<joint name="${prefix}right_finger_joint">
<command_interface name="position" />
<state_interface name="position">
<param name="initial_value">0.00</param>
</state_interface>
<!-- <state_interface name="position" /> -->
<state_interface name="velocity" />
<state_interface name="effort" />
</joint>
<joint name="${prefix}left_finger_joint">
<!-- <param name="mimic">${prefix}right_finger_joint</param> -->
<!-- <param name="multiplier">1</param> -->
<state_interface name="position" />
<state_interface name="velocity" />
<!-- <state_interface name="effort" /> -->
</joint>
</ros2_control>
</xacro:macro>
</robot>

View file

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="gripper_scaled_up_macro">
<xacro:macro name="simple_parallel_gripper" params="prefix parent *origin">
<xacro:include filename="$(find simple_gz_gripper)/urdf/simple_gripper_macro.ros2_control.xacro" />
<!-- gripper base -->
<link name="${prefix}gripper_base">
<visual>
<geometry>
<box size="0.03334 0.06666 0.06666" />
</geometry>
<origin xyz="0 0 0.03334" />
<material name="violet">
<color rgba="0.4 0.18 0.57 1.0" />
</material>
</visual>
<collision>
<geometry>
<box size="0.03334 0.06666 0.06666" />
</geometry>
<origin xyz="0 0 0.03334" />
</collision>
<inertial>
<origin xyz="0 0 0.03334" />
<mass value="0.02" />
<inertia
ixx="1.679e-05" ixy="0.0" ixz="0.0"
iyy="7.437e-06" iyz="0.0"
izz="7.437e-06" />
</inertial>
</link>
<!-- finger right -->
<link name="${prefix}finger_right">
<visual>
<geometry>
<box size="0.02666 0.00666 0.06666" />
</geometry>
<origin xyz="0 -0.00334 0.03334" />
<material name="grey">
<color rgba="0.2 0.2 0.2 1" />
</material>
</visual>
<collision>
<geometry>
<box size="0.02666 0.00666 0.06666" />
</geometry>
<origin xyz="0 -0.00334 0.03334" />
<material name="grey">
<color rgba="0.2 0.2 0.2 1" />
</material>
</collision>
<inertial>
<origin xyz="0 0.00334 0.03334" />
<mass value="0.009876" />
<inertia
ixx="3.694e-06" ixy="0.0" ixz="0.0"
iyy="4.241e-06" iyz="0.0"
izz="6.213e-07" />
</inertial>
</link>
<!-- finger left -->
<link name="${prefix}finger_left">
<visual>
<geometry>
<box size="0.02666 0.00666 0.06666" />
</geometry>
<origin xyz="0 -0.00334 0.03334" />
<material name="grey">
<color rgba="0.2 0.2 0.2 1" />
</material>
</visual>
<collision>
<geometry>
<box size="0.02666 0.00666 0.06666" />
</geometry>
<origin xyz="0 -0.00334 0.03334" />
<material name="grey">
<color rgba="0.2 0.2 0.2 1" />
</material>
</collision>
<inertial>
<origin xyz="0 0.00334 0.03334" />
<mass value="0.009876" />
<inertia
ixx="3.694e-06" ixy="0.0" ixz="0.0"
iyy="4.241e-06" iyz="0.0"
izz="6.213e-07" />
</inertial>
</link>
<!-- joint from parent -->
<joint name="${prefix}base_fixed_joint" type="fixed">
<xacro:insert_block name="origin" />
<parent link="${parent}" />
<child link="${prefix}gripper_base" />
</joint>
<!-- finger joints -->
<joint name="${prefix}right_finger_joint" type="prismatic">
<axis xyz="0 1 0" />
<origin xyz="0.0 0.0 0.06666" rpy="0.0 0.0 0.0" />
<parent link="${prefix}gripper_base" />
<child link="${prefix}finger_right" />
<limit effort="10.0" lower="0" upper="0.02534" velocity="1.0" />
<!-- <dynamics damping="2.0" friction="1.0"/> -->
</joint>
<joint name="${prefix}left_finger_joint" type="prismatic">
<mimic joint="${prefix}right_finger_joint"/>
<axis xyz="0 1 0" />
<origin xyz="0.0 0.0 0.06666" rpy="0.0 0.0 3.1415926535" />
<parent link="${prefix}gripper_base" />
<child link="${prefix}finger_left" />
<limit effort="10.0" lower="0" upper="0.02534" velocity="1.0" />
<!-- <dynamics damping="2.0" friction="1.0"/> -->
</joint>
<xacro:simple_gz_gripper_ros2_control prefix="${prefix}"/>
</xacro:macro>
</robot>