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

changes for ros2 - rebased #22

Merged
merged 16 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .rdmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ check-presence-script: '#!/bin/bash
test -d $BITBOTS_CATKIN_WORKSPACE/src/humanoid_base_footprint'
depends:
- bitbots_docs
ijnek marked this conversation as resolved.
Show resolved Hide resolved
- bitbots_msgs
- geometry_msgs
- message_generation
- rosconsole
Expand Down
97 changes: 61 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1,69 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(humanoid_base_footprint)
add_compile_options(-Wall -Werror -Wno-unused)

find_package(catkin REQUIRED COMPONENTS
roscpp
rosconsole
std_msgs
sensor_msgs
tf2
tf2_eigen
tf2_geometry_msgs
tf_conversions
message_generation
geometry_msgs
rospy
bitbots_docs
bitbots_msgs
rotconv
bitbots_msgs
)

# Add support for C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

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

# Find dependencies
find_package(biped_interfaces REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclcpp_components REQUIRED)
find_package(rotconv REQUIRED)
find_package(tf2_geometry_msgs REQUIRED)
find_package(tf2_ros REQUIRED)

set(THIS_PACKAGE_INCLUDE_DEPENDS
biped_interfaces
Eigen3
rclcpp
rclcpp_components
rotconv
tf2_geometry_msgs
tf2_ros)

# Build
add_library(base_footprint_node SHARED
src/base_footprint.cpp)

target_include_directories(base_footprint_node PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

rclcpp_components_register_node(base_footprint_node
PLUGIN "humanoid_base_footprint::BaseFootprintBroadcaster"
EXECUTABLE base_footprint)

enable_bitbots_docs()
ament_target_dependencies(base_footprint_node ${THIS_PACKAGE_INCLUDE_DEPENDS})

catkin_package(
CATKIN_DEPENDS tf2 rotconv
)
ament_export_targets(export_base_footprint HAS_LIBRARY_TARGET)
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})

include_directories(
include
${catkin_INCLUDE_DIRS}
${Eigen3_INCLUDE_DIRS}
)
# Install
install(
DIRECTORY include/
DESTINATION include)
install(
TARGETS base_footprint_node
EXPORT export_base_footprint
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include)
install(DIRECTORY launch
DESTINATION share/${PROJECT_NAME})

## Declare a C++ executable
add_executable(base_footprint src/base_footprint.cpp)
## Run tests
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

## Specify libraries to link a library or executable target against
target_link_libraries(base_footprint
${catkin_LIBRARIES}
${Eigen3_LIBRARIES}
)
# Package
ament_package()
13 changes: 13 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Any contribution that you make to this repository will
be under the Apache 2 License, as dictated by that
[license](http://www.apache.org/licenses/LICENSE-2.0.html):

~~~
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
~~~
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
# humanoid_base_footprint
This ROS package includes a node which provides the base footprint frame for any humanoid robot following REP - 120.
This ROS2 package includes a node which provides the base footprint frame for any humanoid robot following [REP - 120](https://www.ros.org/reps/rep-0120.html).

## Installation

Only source installation is available currently. Run the following in your ROS workspace:

```
git clone https://github.com/ros-sports/humanoid_base_footprint.git src/humanoid_base_footprint
vcs import src < src/humanoid_base_footprint/dependencies.repos --recursive
colcon build
```

## Description

Definition of the base footprint frame (from [here](https://www.ros.org/reps/rep-0120.html)):

>The base_footprint is the representation of the robot position on the floor. The floor is usually the level where the supporting leg rests, i.e. z = min(l_sole_z, r_sole_z) where l_sole_z and r_sole_z are the left and right sole height respecitvely. The translation component of the frame should be the barycenter of the feet projections on the floor. With respect to the odom frame, the roll and pitch angles should be zero and the yaw angle should correspond to the base_link yaw angle.
>
>Rationale: base_footprint provides a fairly stable 2D planar representation of the humanoid even while walking and swaying with the base_link.

The node listens to [Phase]() msgs that define the current stance of the robot. By default, it will listen on the `walk_support_state` topic, but you can define a list of topics on the `support_state_topics` parameter.

If the links of your robot have non-standard names you can set the following parameters:
`base_link_frame`, `r_sole_frame`, `l_sole_frame`, `l_sole_frame`, `odom_frame`


The resulting frame will be published as `base_footprint` but the name can be changed by setting the `base_footprint_frame` parameter.
4 changes: 4 additions & 0 deletions dependencies.repos
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ repositories:
type: git
url: https://github.com/ros-sports/biped_interfaces.git
version: rolling
rot_conv_lib:
type: git
url: https://github.com/bit-bots/rot_conv_lib.git
version: ros2
Binary file removed docs/_static/logo.png
Binary file not shown.
193 changes: 0 additions & 193 deletions docs/conf.py

This file was deleted.

Loading