Skip to content

Commit 3a67fb7

Browse files
committed
Merge branch 'devel' of https://git.barrett.com/software/libbarrett into jammy-devel
2 parents 87bc36d + e5a0b04 commit 3a67fb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+2322
-604
lines changed

.gitignore

Lines changed: 50 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
1-
# Prerequisites
2-
*.d
1+
# git mergetools
2+
*.orig
3+
*.egg*
4+
*.log
5+
6+
*.pyc
7+
dist
8+
venv
9+
*.egg-info
10+
11+
*.bak
12+
13+
# Eclipse/Project Specific
14+
RemoteSystemsTempFiles/
15+
build/
16+
Release/
17+
.vscode
18+
Debug*/
19+
20+
# Compiled doxygen
21+
docs/html
322

423
# Compiled Object files
524
*.slo
@@ -13,6 +32,7 @@
1332

1433
# Compiled Dynamic libraries
1534
*.so
35+
*.so.*
1636
*.dylib
1737
*.dll
1838

@@ -31,21 +51,32 @@
3151
*.out
3252
*.app
3353

34-
# CMake
35-
CMakeLists.txt.user
36-
CMakeCache.txt
37-
CMakeFiles
38-
CMakeScripts
39-
Testing
40-
Makefile
41-
cmake_install.cmake
42-
install_manifest.txt
43-
compile_commands.json
44-
CTestTestfile.cmake
45-
_deps
46-
barrett-config.cmake
47-
48-
# Build Artifacts
49-
build/
54+
# Doxygen generated files/directories
55+
html/
56+
latex/
57+
Debug/
58+
*.o
59+
*.elf
60+
*.hex
61+
*.map
62+
*~
63+
*.gcda
64+
*.gcno
65+
**/tests/test
66+
*.mk
67+
68+
# CMake generated files
69+
*CMakeFiles/
70+
*Makefile
71+
*.cmake
72+
*CMakeCache.txt
73+
*install_manifest.txt
74+
75+
# Ignore vim swap files
76+
.*.swp
77+
.*.swo
78+
.*.swn
79+
80+
# Libbarrett generated files
5081
Doxyfile
51-
cmake/barrett-config.cmake
82+
include/barrett/config.h
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
### Description
2+
3+
put content here
4+
5+
### What to focus on
6+
7+
- put content here.
8+
9+
### Reviewers
10+
11+
- [ ] @alexandros
12+
- [ ] @amyblank
13+
- [ ] @bz
14+
- [ ] @tn
15+
16+
### Resources
17+
18+
### Issues
19+
> What issues does this fix?
20+
21+
- Fixes #issue-number
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### Description
2+
> What does this release do?
3+
4+
- **Releases**:
5+
- `<Release Name>` (`<version-to-release>`)
6+
7+
### Changelog
8+
> An enumerated list of important changes
9+
10+
- put content here.
11+
12+
### Reviewers
13+
14+
- [ ] @alexandros
15+
- [ ] @amyblank
16+
- [ ] @bz
17+
- [ ] @tn
18+
19+
### Resources and Documentation
20+
> Links for resources and documentation go here.

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## [Unreleased]
6+
7+
- Added wamudpd script that makes PCs findable by the wamdiscover script.
8+
- Updated wamudpd script to run using python3
9+
10+
## [dev-3.0.1]
11+
12+
- Increased enumeration timeout from 1 ms to 5 ms
13+
14+
## [dev-3.0.0]
15+
16+
- Python3 support
17+
- Clang support
18+
- Updated dependencies (Boost, Eigen, Freeglut)
19+
- Allowed WAM loop to run while reading BHand sensors
20+
- Converted ex10 haptics visualization from vpython to OpenGL
21+
- Based WAM loop on a (100x) more accurate timer_fd instead of sleep()
22+
- More robust installation script
23+
- Improved mutex handling for non-rt operation
24+
- Offered Top10 tactile values from BHand for higher update rates
25+
26+
[dev-3.0.1]: https://git.barrett.com/software/libbarrett/-/tags/dev-3.0.1
27+
[dev-3.0.0]: https://git.barrett.com/software/libbarrett/-/tags/dev-3.0.0
28+

CMakeLists.txt

Lines changed: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
cmake_minimum_required(VERSION 2.6)
22

33
project(libbarrett)
4-
set(libbarrett_VERSION_MAJOR 1)
5-
set(libbarrett_VERSION_MINOR 2)
6-
set(libbarrett_VERSION_PATCH 4)
4+
set(libbarrett_VERSION_MAJOR 3)
5+
set(libbarrett_VERSION_MINOR 0)
6+
set(libbarrett_VERSION_PATCH 1)
77
set(libbarrett_VERSION "${libbarrett_VERSION_MAJOR}.${libbarrett_VERSION_MINOR}.${libbarrett_VERSION_PATCH}")
88
set(libbarrett_SOVERSION "${libbarrett_VERSION_MAJOR}.${libbarrett_VERSION_MINOR}")
99

@@ -20,7 +20,6 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules/")
2020

2121
### Options
2222
option(BUILD_SHARED_LIBS "Set to OFF to build static libraries" ON)
23-
option(NON_REALTIME "Set to ON to avoid building code that depends on a real-time operating system" OFF)
2423
option(OPTIMIZE_FOR_PROCESSOR "Set to ON to build binaries that are optimized for this specific computer and can't be copied to other machines" OFF)
2524
option(WITH_PYTHON "Set to ON to build Python bindings for libbarrett" ON)
2625
option(INSTALL_EXAMPLES "Set to ON to copy libbarrett example programs to the current user's home folder when the library is installed" OFF)
@@ -34,6 +33,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-int-in-bool-context -Wno-ignored-at
3433

3534
if (OPTIMIZE_FOR_PROCESSOR)
3635
# TODO(dc): Does this turn on sse2 if supported by processor? What about -mfpmath=sse?
36+
# WARNING: This option results in frequent segfaults (why?)
3737
set(NEW_FLAGS "-march=native -mtune=native")
3838

3939
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NEW_FLAGS}")
@@ -80,22 +80,6 @@ include_directories("${PROJECT_BINARY_DIR}/include")
8080
set(exported_include_dirs ${exported_include_dirs} ${CMAKE_INSTALL_PREFIX}/include)
8181
set(exported_link_dirs ${exported_link_dirs} ${CMAKE_INSTALL_PREFIX}/lib)
8282

83-
84-
## Xenomai
85-
if (NON_REALTIME)
86-
message(STATUS "NON_REALTIME: Not using Xeonmai")
87-
else()
88-
find_package(Xenomai REQUIRED)
89-
include_directories(${XENOMAI_INCLUDE_DIR}/trank)
90-
include_directories(${XENOMAI_INCLUDE_DIR}) # Needed twice for include_next
91-
include_directories(${XENOMAI_INCLUDE_DIR}/cobalt)
92-
add_definitions(${XENOMAI_DEFINITIONS})
93-
94-
set(exported_include_dirs ${exported_include_dirs} ${XENOMAI_INCLUDE_DIR} ${XENOMAI_INCLUDE_DIR}/cobalt)
95-
set(exported_definitions ${exported_definitions} ${XENOMAI_DEFINITIONS})
96-
endif()
97-
98-
9983
## GSL
10084
find_package(GSL REQUIRED)
10185
include_directories(${GSL_INCLUDE_DIRS})
@@ -104,32 +88,42 @@ link_directories(${GSL_LIBRARY_DIRS})
10488
set(exported_include_dirs ${exported_include_dirs} ${GSL_INCLUDE_DIRS})
10589
set(exported_link_dirs ${exported_link_dirs} ${GSL_LIBRARY_DIRS})
10690

91+
## Python
92+
if (WITH_PYTHON)
93+
find_package(PythonLibs REQUIRED)
94+
include_directories(${PYTHON_INCLUDE_PATH})
95+
endif()
10796

10897
## Boost
109-
# Python snippet to generate version list:
110-
#for minor in range(45, 60):
111-
# print '"1.%d" "1.%d.0"' % (minor, minor),
112-
set(Boost_ADDITIONAL_VERSIONS "1.45" "1.45.0" "1.46" "1.46.0" "1.47" "1.47.0" "1.48" "1.48.0" "1.49" "1.49.0" "1.50" "1.50.0" "1.51" "1.51.0" "1.52" "1.52.0" "1.53" "1.53.0" "1.54" "1.54.0" "1.55" "1.55.0" "1.56" "1.56.0" "1.57" "1.57.0" "1.58" "1.58.0" "1.59" "1.59.0")
113-
set(boost_components system thread program_options)
98+
set(boost_components system thread)
11499
if (WITH_PYTHON)
115-
set(boost_components ${boost_components} python)
100+
# Extract major/minor python version
101+
string(REPLACE "." ";" VERSION_LIST ${PYTHONLIBS_VERSION_STRING})
102+
list(GET VERSION_LIST 0 PYTHONLIBS_VERSION_MAJOR)
103+
list(GET VERSION_LIST 1 PYTHONLIBS_VERSION_MINOR)
104+
105+
set(boost_components ${boost_components} python${PYTHONLIBS_VERSION_MAJOR}${PYTHONLIBS_VERSION_MINOR})
116106
endif()
117-
find_package(Boost 1.45.0 REQUIRED ${boost_components})
107+
message(STATUS "Boost components: ${boost_components}")
108+
find_package(Boost REQUIRED ${boost_components})
109+
110+
## Translate cmake's new "Boost::blah" library naming format to a normal "libboost_blah" name that can be passed to the linker.
111+
## TODO(bz): Hunt down anyone who makes stupid changes like this and make them suffer.
112+
set(boost_libraries "")
113+
foreach (prop ${Boost_LIBRARIES})
114+
get_target_property(lib ${prop} LOCATION)
115+
message(STATUS "The name ${prop} has location: ${lib}.")
116+
set(boost_libraries ${boost_libraries} ${lib})
117+
endforeach(prop)
118+
set(Boost_LIBRARIES ${boost_libraries})
119+
118120
include_directories(${Boost_INCLUDE_DIRS})
119121
link_directories(${Boost_LIBRARY_DIRS})
120122

121123
set(exported_include_dirs ${exported_include_dirs} ${Boost_INCLUDE_DIRS})
122124
set(exported_link_dirs ${exported_link_dirs} ${Boost_LIBRARY_DIRS})
123125

124-
125-
## Python
126-
if (WITH_PYTHON)
127-
find_package(PythonLibs REQUIRED)
128-
include_directories(${PYTHON_INCLUDE_PATH})
129-
endif()
130-
131-
132-
## Eigen2
126+
## Eigen3
133127
find_package(Eigen3 REQUIRED)
134128
include_directories(${Eigen_INCLUDE_DIRS})
135129
set(exported_include_dirs ${exported_include_dirs} ${Eigen_INCLUDE_DIRS})
@@ -172,10 +166,10 @@ configure_file(${PROJECT_SOURCE_DIR}/cmake/barrett-config.cmake.in ${PROJECT_SOU
172166
ESCAPE_QUOTES @ONLY
173167
)
174168
if (CONFIG_DEBIAN)
175-
message(STATUS "Using standard barrett-config.cmake for Debian installation.")
176-
install(FILES ${PROJECT_SOURCE_DIR}/cmake/debian/barrett-config.cmake
177-
DESTINATION share/barrett
178-
)
169+
message(STATUS "Using standard barrett-config-non-realtime.cmake for Debian installation.")
170+
install(FILES ${PROJECT_SOURCE_DIR}/cmake/debian/barrett-config-non-realtime.cmake
171+
DESTINATION share/barrett
172+
)
179173
message(STATUS "Temporarily installing configuration files.")
180174
install(DIRECTORY ${PROJECT_SOURCE_DIR}/config/
181175
DESTINATION share/barrett/config
@@ -313,9 +307,6 @@ if (CONFIG_PACKAGE)
313307
set(CPACK_DEBIAN_PACKAGE_NAME "libbarrett-dev")
314308
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "${CPACK_PACKAGE_CONTACT}")
315309
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libconfig-barrett (>=1.4.5), libboost-thread-dev (>= 1.45.0), libboost-python-dev (>=1.45.0), libgsl0-dev (>=1.14), libncurses5-dev, python-dev (>=2.7)")
316-
if (NOT NON_REALTIME)
317-
set(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libxenomai-dev (>= 2.5.5.2)")
318-
endif()
319310
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION_SUMMARY "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
320311
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION}")
321312
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Libbarrett 3.0.0
2+
> Libbarrett is a real-time controls library written in C++ that runs Barrett
3+
Technology products (WAM and BarrettHand)
4+
5+
` This version of Libbarrett works with a non-real-time kernel (a low-latency Ubuntu 20.04 kernel) and should only be used when a hard real-time guarantee is not critical for your application.`
6+
7+
8+
### Download package
9+
```
10+
cd && git clone https://git.barrett.com/software/libbarrett
11+
```
12+
13+
### Install dependencies
14+
```
15+
cd ~/libbarrett/scripts && ~/libbarrett/scripts/install_dependencies.sh
16+
```
17+
18+
### Reboot into the new kernel (after reboot, "uname -r" should show "lowlatency"):
19+
```
20+
sudo reboot
21+
```
22+
23+
### Build and install the Peak pcan driver
24+
We recommend the following CAN hardware:
25+
26+
- PCAN-PCI
27+
- PCAN-PCIe
28+
- PCAN-USB
29+
- PCAN-ISA
30+
31+
NOTE: These cards are supported by the SocketCAN driver built into Linux, however, we have found that the SocketCAN txbuffer can occasionally fail to send CAN frames without reporting an error, and this causes the WAM to E-Stop itself unexpectedly. This can happen a few seconds, a few minutes, or even several hours after starting a WAM application. Fortunately, Peak offers an alternative driver (pcan) which is still socket-based but avoids this SocketCAN bug.
32+
```
33+
sh ~/libbarrett/scripts/install_pcan.sh
34+
```
35+
36+
### For PCAN-ISA only, manually configure the driver (not plug-and-play):
37+
```
38+
sudo tee /etc/modprobe.d/pcan.conf <<EOF
39+
options pcan type=isa,isa io=0x300,0x320 irq=7,5
40+
install pcan modprobe --ignore-install pcan
41+
EOF
42+
echo 'pcan' |sudo tee -a /etc/modules-load.d/modules.conf
43+
```
44+
45+
### Reboot to use the new CAN driver (after reboot, both "cat /proc/pcan" and "ifconfig" should list can0):
46+
```
47+
sudo reboot
48+
```
49+
50+
### Build libbarrett (using clang)
51+
```
52+
export CC=/usr/bin/clang
53+
export CXX=/usr/bin/clang++
54+
cd ~/libbarrett && cmake .
55+
make -j$(nproc)
56+
```
57+
58+
### Install libbarrett
59+
```
60+
sudo make install
61+
```
62+
63+
### Build the libbarrett example programs
64+
```
65+
cd ~/libbarrett/examples && cmake .
66+
make -j$(nproc)
67+
```
68+
69+
### Additional Makefile targets
70+
Optional: Update or install configuration files only - not necessary if you have already done a full make (above)
71+
```
72+
make install_config
73+
```
74+
75+
Optional: Package the library as a tar-ball (not common)
76+
```
77+
make package
78+
```
79+
80+
### Configuration Files for the WAM
81+
Upon installation of libbarrett, the configuration files of the robot are installed to the `/etc/barrett` directory. However, to give an additional flexibility of each user maintaining their own configurations for the same robot, by default, the configuration files are read from `~/.barrett` directory if it exists. If not, then libbarrett reads the necessary configuration files from `/etc/barrett/` directory. It is up to the user to maintain and populate the `~/.barrett` directory.
82+
83+
### Eclipse IDE setup
84+
It is possible to use CMake to generate several output formats, including Eclipse CDT4 project files. For details, see:
85+
http://www.paraview.org/Wiki/Eclipse_CDT4_Generator
86+
To generate Eclipse project files, run:
87+
```
88+
cmake . -G"Eclipse CDT4 - Unix Makefiles"
89+
```
90+
Then import the generated project into your Eclipse workspace using:
91+
File -> Import -> General -> Existing Projects into Workspace

README.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Download and install libbarrett:
2828
$ cd ~/
2929
$ git clone https://git.barrett.com/software/libbarrett.git
3030
$ cd libbarrett
31+
$ git checkout devel-14.04
3132
$ cmake .
3233
$ make
3334
$ sudo make install
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set(BARRETT_INCLUDE_DIRS /usr/local/include/eigen3;/usr/include/eigen3)
2+
set(BARRETT_DEFINITIONS -D_GNU_SOURCE -D_REENTRANT -Wall -pipe -D__XENO__)
3+
set(BARRETT_LIBRARIES libboost_thread-mt.so;pthread;libboost_python.so;-L/usr/lib;-lgsl;-lgslcblas;-lm;config;config++;libpython2.7.so;barrett)

0 commit comments

Comments
 (0)