Skip to content

Commit

Permalink
Merge branch 'feature/fingertip_distance_publisher_node' into 'master'
Browse files Browse the repository at this point in the history
Overwrite existing master with shiny new improved version

See merge request senseglove/ros_workspace!11
  • Loading branch information
RPKrijnen committed May 20, 2021
2 parents 9336bc9 + 290e3d2 commit 6f64fcf
Show file tree
Hide file tree
Showing 274 changed files with 1,872 additions and 1,037 deletions.
16 changes: 14 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
build/
devel/
install/
log/
SenseGlove_API/
logs/
venv/

.idea/*
SenseGlove_API/Core/*
SenseGlove_API/Examples/*
SenseGlove_API/.gitignore
SenseGlove_API/README.md

src/hardware_interface/senseglove_hardware/SenseCom/Linux/sessionLog.txt
src/cmake-build-debug/*
src/CMakeLists.txt

.idea/*
.catkin_tools/*
12 changes: 6 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
image: docker:git
services:
- docker:dind
- docker:19.03.5-dind
before_script:
- apk add --update bash coreutils tar
- apk add --update bash coreutils tar grep
- git clone --quiet --depth 1 https://github.com/ros-industrial/industrial_ci .industrial_ci -b master
melodic:
script: .industrial_ci/gitlab.sh ROS_DISTRO=melodic
variables:
BUILDER: colcon
CATKIN_LINT: pedantic
CATKIN_LINT_ARGS: '--ignore external_directory'
# CLANG_FORMAT_CHECK: file
ROSDEP_SKIP_KEYS: "SenseGlove_API"
CATKIN_LINT_ARGS: '--ignore uninstalled_script --ignore external_directory'
CLANG_TIDY: 'true'
# CLANG_TIDY_ARGS: '-style=file'
ROSDEP_SKIP_KEYS: "SenseGlove_API hardware_interface/senseglove_hardware/SenseCom/*"
artifacts:
paths:
- node_modules/
Expand Down
75 changes: 65 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,78 @@
# Senseglove ros_workspace

A workspace for the integration of the SenseGlove into ROS Melodic.
This workspace makes use of ros_control for automatically initiating publisher and subscriber nodes for the state of the senseglove.

## General Usage: ##
## 1. For ROS beginners: ##
If you are totally unfamiliar with ROS we advise you to take a look at the ROS-wiki for a quick startup guide.
We especially recommend the following tutorials:
* http://wiki.ros.org/melodic/Installation/Ubuntu
* http://wiki.ros.org/ROS/StartGuide
* http://wiki.ros.org/ROS/Tutorials
* http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment
* http://wiki.ros.org/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29

A large part of understanding/working with ROS is the ability to search for the issues you are dealing with.
In our experience, simply googling for an error or issue you have can do the trick. Do keep in mind that there exists a
vast amount of documentation, though it can be tedious to sort through its information.

### setting up the workspace for the senseglove: ###
1. Make sure you are on a Ubuntu 18.04 system (not necessary, but all code has been checked with docker images running in ubuntu).
2. Download ros-melodic as described in the ros-wiki.
3. clone our workspace by either using `git clone https://github.com/Adjuvo/senseglove_ros_ws.git` or through the webbrowser here on the Github website.
4. install the following dependencies:
1. `sudo apt-get install ros-melodic-ros-control`
2. `sudo apt-get install ros-melodic-joint-trajectory-controller`
5. Run: `sudo apt-get update`
6. Run: `rosdep update`
7. Run: `sudo apt-get upgrade`
8. navigate, in the terminal, to the workspace folder
9. source your workspace: `source /opt/ros/melodic/setup.bash`
10. Build your workspace: `catkin build`
1. or if you prefer a different build tool use: `catkin_make`
2. or use: `colcon build`
11. after building, you can source the workspace itself by using `source devel/setup.bash`

## 2. General Usage: ##
This repository is meant to present a solid foundation for using the senseglove in ROS Melodic. As such it provides no
concrete example projects. It does however provide the user with a few launch files, hardware.launch and senseglove_demo.launch
concrete example projects. It does however provide the user with a few launch files, hardware.launch and senseglove_demo.launch
which initiate the sensegloves.
The senseglove_hardware_interface nodes which are called by these launch files do nothing more than using the senseglove API
in a ROS /ros_control "sanctioned" manner.

__Important:__ Run the sensecom application, present in the SenseGlove_API folder, before launch!
__Important:__ Run the sensecom application, present in the SenseGlove_API folder, when using hardware.launch! The launching of sensecom
has been taken care of in senseglove_demo.launch in the bash script.

Users are advised to develop their own applications outside this package and make use of the provided topics. If users do find the need to
write additions to this package, beware that this repository is still subject to changes and pulling this repo again might override your own code.

**If you, as a user, find a bug or have an issue with getting the workspace up and running, we suggest you leave this as an issue on this repository.**
This practice will allow others to troubleshoot their own problems quicker.

### Example; using two sensegloves in ROS: ###
1. source your workspace
2. make sure your sensegloves are connected through usb or bluetooth
1. if you checked your connection with sensecom, be sure to exit the application before proceeding
3. run: `roslaunch senseglove_demo.launch`

A bash script is called invoking sensecom and running the hardware interface node twice for a left- and a right-handed glove.
If all is well, your invocation of the roslaunch command should have started a roscore session and all necessary nodes providing intefaces to the senseglove.
In a second (properly sourced) terminal you can verify that these nodes are publishing by invoking: rostopic list
you can further test the application by checking that these topics get published by invoking: rostopic echo /topic_name

### Example; using a single senseglove in ROS: ###
Though the whole infrastructure of this codebase was built upon the use with infinitely many sensgloves, our example launch file only accepts two gloves.
Moreover, due to our integration into ros-control we require the user to know what type of gloves are connected to the PC.
As such, the user has to define which glove is connected to the system.

Users are advised to build their own nodes in the senseglove folder as if it were a separate repository when transforming
values from the senseglove. When making use of the topics in your own application, it is expected that these nodes are developed
in your own package.
1. find out if you are dealing with a left- or right-handed senseglove
2. remove the non-existing glove from the senseglove_hardware_demo.launch file, such that only your left/right-handed glove remains.
3. save the launch file
4. build you workspace
5. source your workspace
6. proceed as if you were dealing with 2 sensegloves

## To do: ##
* Implement standard CLang format, currently none are used (code adheres to no singular style, big oof)
## 3. To do: ##
This is a small to do list for the upcoming features in this repository these will be added as issues as well.
* Custom Exceptions for easy debugging
* adjust .gitlab-ci.yml to include clang only if it does not check the SenseGlove_API package due to style differences.
* Provide specialized script for using a single senseglove
* Provide speed and acceleration data of the fingertippositions as well as for the encoder data.
4 changes: 4 additions & 0 deletions src/SenseGlove_API/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
DisableFormat: true
SortIncludes: Never
...
35 changes: 14 additions & 21 deletions src/hardware_interface/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,19 @@
BasedOnStyle: Google
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLoopsOnASingleLine: false
AlwaysBreakTemplateDeclarations: true
AlwaysBreakTemplateDeclarations: Yes
AlwaysBreakBeforeMultilineStrings: false
BreakBeforeBinaryOperators: false
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: true
BinPackParameters: true
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: true
DerivePointerBinding: false
PointerBindsToType: true
ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
MaxEmptyLinesToKeep: 1
Expand All @@ -36,31 +32,28 @@ Standard: Auto
IndentWidth: 2
TabWidth: 2
UseTab: Never
IndentFunctionDeclarationAfterType: false
SpacesInParentheses: false
SpacesInAngles: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpaceAfterControlStatementKeyword: true
SpaceBeforeAssignmentOperators: true
ContinuationIndentWidth: 4
SortIncludes: false
SortIncludes: Never
SpaceAfterCStyleCast: false

# Configure each individual brace in BraceWrapping
BreakBeforeBraces: Custom

# Control of individual brace wrapping cases
BraceWrapping: {
AfterClass: 'true'
AfterControlStatement: 'true'
AfterEnum : 'true'
AfterFunction : 'true'
AfterNamespace : 'true'
AfterStruct : 'true'
AfterUnion : 'true'
BeforeCatch : 'true'
BeforeElse : 'true'
IndentBraces : 'false'
}
BraceWrapping:
AfterClass: true
AfterControlStatement: 'true'
AfterEnum : true
AfterFunction : true
AfterNamespace : true
AfterStruct : true
AfterUnion : true
BeforeCatch : true
BeforeElse : true
IndentBraces : false
...
6 changes: 6 additions & 0 deletions src/hardware_interface/senseglove_hardware/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,17 @@ install(DIRECTORY include/${PROJECT_NAME}/
DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

install(DIRECTORY SenseCom
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
)

# install(PROGRAMS SenseCom/Linux/SenseCom.x86_64 DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

### Add gtest based cpp test target and link libraries
#if(CATKIN_ENABLE_TESTING)
# catkin_add_gmock(${PROJECT_NAME}_test
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Session: 2021-02-03 20-28-36
Session: 2021-03-29 13-42-40
Running SenseCom v0.10
OS: Linux - Linux 4.15 Ubuntu 18.04 64bit

Expand All @@ -13,8 +13,6 @@ Shutdown initiated from SenseCom_Base. Final Device information:
Ports:

Devices:
0: SenseGlove DK1.2-L0015 (DK1.2) running firmware v4.9. Connected via Serial (/dev/ttyACM0)
1: SenseGlove DK1.3-R0026 (DK1.3) running firmware v4.9. Disconnected

Attempting to close connections and dispose of resources...
Disposed of communications with code: 1
Expand Down
File renamed without changes.
Loading

0 comments on commit 6f64fcf

Please sign in to comment.