Skip to content

Commit

Permalink
Added srv
Browse files Browse the repository at this point in the history
Signed-off-by: Juancams <[email protected]>
  • Loading branch information
Juancams committed Jul 3, 2024
1 parent b630740 commit 390d32d
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/humble_devel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Build ROS 2 package
uses: ros-tooling/[email protected]
with:
package-name: go2_robot go2_description go2_bringup go2_driver go2_hardware go2_simulation unitree_api unitree_go
package-name: go2_robot go2_description go2_bringup go2_driver go2_hardware go2_simulation unitree_api unitree_go go2_interfaces
target-ros2-distro: humble
colcon-defaults: |
{
Expand Down
33 changes: 33 additions & 0 deletions go2_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.8)
project(go2_interfaces)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(rosidl_default_generators REQUIRED)
find_package(ament_cmake REQUIRED)
find_package(std_msgs REQUIRED)

rosidl_generate_interfaces(${PROJECT_NAME}
"srv/BodyHeight.srv"
"srv/ContinuousGait.srv"
"srv/Euler.srv"
"srv/FootRaiseHeight.srv"
"srv/Mode.srv"
"srv/Pose.srv"
"srv/SpeedLevel.srv"
"srv/SwitchGait.srv"
"srv/SwitchJoystick.srv"
DEPENDENCIES
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE)
set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_package()
23 changes: 23 additions & 0 deletions go2_interfaces/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0"?>
<?xml-model href=""?>
<package format="3">
<name>go2_interfaces</name>
<version>0.0.1</version>
<description>Go2 Interfaces</description>
<maintainer email="[email protected]">Juan Carlos Manzanares</maintainer>
<license>BSD 3-Clause License</license>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<depend>rosidl_default_generators</depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
6 changes: 6 additions & 0 deletions go2_interfaces/srv/BodyHeight.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set the relative height of the body above the ground when standing and walking.
float32 height

---
bool success
string message
6 changes: 6 additions & 0 deletions go2_interfaces/srv/ContinuousGait.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Continuous movement

bool flag

---
bool success
9 changes: 9 additions & 0 deletions go2_interfaces/srv/Euler.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Posture when standing and walking

float32 roll
float32 pitch
float32 yaw

---
bool success
string message
7 changes: 7 additions & 0 deletions go2_interfaces/srv/FootRaiseHeight.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Set the relative height of foot lift during movement

float32 height

---
bool success
string message
5 changes: 5 additions & 0 deletions go2_interfaces/srv/Mode.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
string mode

---
bool success
string message
6 changes: 6 additions & 0 deletions go2_interfaces/srv/Pose.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Set true to pose and false to restore

bool flag

---
bool success
7 changes: 7 additions & 0 deletions go2_interfaces/srv/SpeedLevel.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Set the speed range

int32 level

---
bool success
string message
13 changes: 13 additions & 0 deletions go2_interfaces/srv/SwitchGait.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Switch gait

int32 IDLE = 0
int32 TROT = 1
int32 TROT_RUN_NING = 2
int32 FORWARD_CLIMBING_MODE = 3
int32 REVERSE_CLIMBING_MODE = 4

int32 d

---
bool success
string message
6 changes: 6 additions & 0 deletions go2_interfaces/srv/SwitchJoystick.srv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Native remote control response switch

bool flag

---
bool success

0 comments on commit 390d32d

Please sign in to comment.