Skip to content

Commit 824a5a1

Browse files
committed
feat(pressure_sensors): extract out handling from ros_control
to allow usage of the actual `pressure_converter` in simulation without requiring dynamixel motor handling and other lowlevel components.
1 parent e21b6f1 commit 824a5a1

File tree

16 files changed

+1266
-1
lines changed

16 files changed

+1266
-1
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
project(bitbots_pressure_sensors)
3+
4+
# Add support for C++17
5+
if(NOT CMAKE_CXX_STANDARD)
6+
set(CMAKE_CXX_STANDARD 17)
7+
endif()
8+
9+
# Build with release optimizations and debug symbols by default
10+
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
11+
set(CMAKE_BUILD_TYPE RelWithDebug)
12+
endif()
13+
14+
find_package(ament_cmake REQUIRED)
15+
find_package(ament_index_cpp REQUIRED)
16+
find_package(bitbots_msgs REQUIRED)
17+
# find_package(controller_interface REQUIRED) find_package(controller_manager
18+
# REQUIRED)
19+
find_package(diagnostic_msgs REQUIRED)
20+
# find_package(hardware_interface REQUIRED) find_package(moveit_core REQUIRED)
21+
# find_package(moveit_ros_planning REQUIRED) find_package(pluginlib REQUIRED)
22+
find_package(rclcpp REQUIRED)
23+
find_package(rosidl_typesupport_cpp REQUIRED)
24+
find_package(std_msgs REQUIRED)
25+
find_package(std_srvs REQUIRED)
26+
find_package(tf2_ros REQUIRED)
27+
# find_package(transmission_interface REQUIRED)
28+
find_package(yaml-cpp REQUIRED)
29+
30+
set(INCLUDE_DIRS include)
31+
include_directories(${INCLUDE_DIRS})
32+
33+
set(CMAKE_CXX_STANDARD 17)
34+
add_compile_options(-Wall -Werror -Wno-unused -pedantic -Wextra)
35+
36+
set(SOURCES src/pressure_converter.cpp)
37+
38+
# enable_bitbots_docs()
39+
40+
add_executable(pressure_converter ${SOURCES})
41+
ament_target_dependencies(
42+
pressure_converter
43+
ament_cmake
44+
ament_index_cpp
45+
bitbots_msgs
46+
# controller_interface controller_manager
47+
diagnostic_msgs
48+
# hardware_interface moveit_core moveit_ros_planning pluginlib
49+
rclcpp
50+
rosidl_typesupport_cpp
51+
std_msgs
52+
std_srvs
53+
tf2_ros
54+
# transmission_interface
55+
yaml-cpp)
56+
target_link_libraries(pressure_converter yaml-cpp)
57+
58+
ament_export_dependencies(ament_cmake)
59+
ament_export_dependencies(bitbots_msgs)
60+
# ament_export_dependencies(controller_interface)
61+
# ament_export_dependencies(controller_manager)
62+
# ament_export_dependencies(hardware_interface)
63+
# ament_export_dependencies(pluginlib)
64+
ament_export_dependencies(std_msgs)
65+
ament_export_dependencies(tf2_ros)
66+
# ament_export_dependencies(transmission_interface)
67+
68+
install(TARGETS pressure_converter DESTINATION lib/${PROJECT_NAME})
69+
install(DIRECTORY config DESTINATION share/${PROJECT_NAME})
70+
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})
71+
install(DIRECTORY scripts/ USE_SOURCE_PERMISSIONS
72+
DESTINATION lib/${PROJECT_NAME})
73+
74+
ament_package()
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pressure_converter:
2+
ros__parameters:
3+
zero_r:
4+
- -27455372.92
5+
- 14459386.46
6+
- 17952654.76
7+
- -10605254.74
8+
zero_l:
9+
- -14063383.6
10+
- 30331751.92
11+
- -2034247.26
12+
- 48130515.2
13+
scale_r:
14+
- 2.879445523352348e-06
15+
- -2.252145560713656e-05
16+
- -2.754225471994077e-06
17+
- 2.763926644524643e-06
18+
scale_l:
19+
- 2.879445523352348e-06
20+
- -2.252145560713656e-05
21+
- -2.754225471994077e-06
22+
- 2.763926644524643e-06
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pressure_converter:
2+
ros__parameters:
3+
left_topic: "/foot_pressure_left"
4+
right_topic: "/foot_pressure_right"
5+
average: 5
6+
scale_and_zero_average: 50
7+
cop_threshold: 5.0

bitbots_lowlevel/bitbots_pressure_sensors/config/pressure_donna.yaml

Whitespace-only changes.

bitbots_lowlevel/bitbots_pressure_sensors/config/pressure_jack.yaml

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pressure_converter:
2+
ros__parameters:
3+
zero_r:
4+
- -27455372.92
5+
- 14459386.46
6+
- 17952654.76
7+
- -10605254.74
8+
zero_l:
9+
- -14063383.6
10+
- 30331751.92
11+
- -2034247.26
12+
- 48130515.2
13+
scale_r:
14+
- 2.879445523352348e-06
15+
- -2.252145560713656e-05
16+
- -2.754225471994077e-06
17+
- 2.763926644524643e-06
18+
scale_l:
19+
- 2.879445523352348e-06
20+
- -2.252145560713656e-05
21+
- -2.754225471994077e-06
22+
- 2.763926644524643e-06
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pressure_converter:
2+
ros__parameters:
3+
zero_r:
4+
- 48308998.54257341
5+
- -55854838.35192279
6+
- 98076369.19309235
7+
- -39246077.40848633
8+
zero_l:
9+
- -67084141.6669952
10+
- 56469139.33715566
11+
- -85340727.53204206
12+
- -6584181.771324467
13+
scale_r:
14+
- -5.719128286267938e-08
15+
- -3.441808570613519e-08
16+
- 3.580081515665939e-08
17+
- 3.67922464123119e-08
18+
scale_l:
19+
- -5.719128286267938e-08
20+
- -3.441808570613519e-08
21+
- 3.580081515665939e-08
22+
- 3.67922464123119e-08
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
pressure_converter:
2+
ros__parameters:
3+
zero_r:
4+
- 48308998.54257341
5+
- -55854838.35192279
6+
- 98076369.19309235
7+
- -39246077.40848633
8+
zero_l:
9+
- -67084141.6669952
10+
- 56469139.33715566
11+
- -85340727.53204206
12+
- -6584181.771324467
13+
scale_r:
14+
- -5.719128286267938e-08
15+
- -3.441808570613519e-08
16+
- 3.580081515665939e-08
17+
- 3.67922464123119e-08
18+
scale_l:
19+
- -5.719128286267938e-08
20+
- -3.441808570613519e-08
21+
- 3.580081515665939e-08
22+
- 3.67922464123119e-08

0 commit comments

Comments
 (0)