Skip to content

Commit

Permalink
cloned repos
Browse files Browse the repository at this point in the history
  • Loading branch information
mrceki committed Jan 12, 2023
1 parent b063667 commit 31767f0
Show file tree
Hide file tree
Showing 41 changed files with 8,181 additions and 0 deletions.
53 changes: 53 additions & 0 deletions qbdevice-ros/qb_device_driver/api/qbdevice-api-7.x.x/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# These are some examples of commonly ignored file patterns.
# You should customize this list as applicable to your project.
# Learn more about .gitignore:
# https://www.atlassian.com/git/tutorials/saving-changes/gitignore

# Build folder
build/

# Node artifact files
node_modules/
dist/

# Compiled Java class files
*.class

# Compiled Python bytecode
*.py[cod]

# Log files
*.log

# Package files
*.jar

# Maven
target/
dist/

# JetBrains IDE
.idea/

# Unit test reports
TEST*.xml

# Generated by MacOS
.DS_Store

# Generated by Windows
Thumbs.db

# Applications
*.app
*.exe
*.war

# Large media files
*.mp4
*.tiff
*.avi
*.flv
*.mov
*.wmv

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "qbrobotics-driver"]
path = qbrobotics-driver
url = https://[email protected]/qbrobotics/qbrobotics-driver.git
[submodule "serial"]
path = serial
url = https://bitbucket.org/qbrobotics/serial.git
32 changes: 32 additions & 0 deletions qbdevice-ros/qb_device_driver/api/qbdevice-api-7.x.x/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package qbdevice-api-7.x.x
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1.1.3 (2022-07-18)
------------------
* Bug fixed in qbrobotics-driver pkg with installation directory

1.1.2 (2022-07-15)
------------------
* Increased timeout in qbrobotics-driver pkg to improve device scanning on Windows PCs

1.1.1 (2022-07-14)
------------------
* GNUInstallDirs icluded in Serial project as installation paths were not found in some tests.


1.1.0 (2022-07-13)
------------------
* Added set/get hand side parameter for SH2R

1.0.2 (2022-07-07)
------------------
* Bug fixed in homing function

1.0.1 (2022-07-06)
------------------
* Changed cmake version

1.0.0 (2020-05-05)
------------------
* Alarm Bells Began To Ring
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 3.5.1)
project(qbrobotics_device_API VERSION 1.1.3 LANGUAGES CXX)
message("-- [ ${PROJECT_NAME}] start compiling")

# Add dependencies in the order you want them to build.
add_subdirectory(serial)
add_subdirectory(qbrobotics-driver)
35 changes: 35 additions & 0 deletions qbdevice-ros/qb_device_driver/api/qbdevice-api-7.x.x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# qbdevice API

C++ API to control qbrobotics devices (SoftHand Industry, SoftHand Research, SoftHand2 Research and qbmove)

## Get this project
In order to clone this project and all its submodules, execute the following command:
```
git clone --recurse-submodules https://bitbucket.org/qbrobotics/qbdevice-api-7.x.x.git
```

## INSTALLATION

### Research devices
In order to compile the libraries (static or dynamic) to be used in external projects, it is necessary to build both __Serial__ and __qbrobotics-driver__ projects.

Execute the following commands, in order to compile the project:
```
mkdir build
cd build
cmake ..
make
```
Now the **build** folder should contain:
- **qbrobotics-driver-internal** folder, with libqbrobotics_driver.a or libqbrobotics_driver.so library;
- **serial** folder, with libSerial.a or libSerial.so library.

Use them to exploit qbrobotics API in external projects.

---
**NOTE**

In order to compile **STATIC** or **DYNAMIC** libraries just move to each of CMakeLists.txt files contained inside **qbrobotics-driver-internal** and **serial** folders and edit the **add_library** line in that file.

---

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.idea/
.vscode/

*.pro.*
*.autosave
build/
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package qbrobotics_driver
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

7.1.2 (2022-07-18)
------------------
* Bug fixed with installation directory

7.1.1 (2022-07-15)
------------------
* Increased timeout to improve device scanning on Windows PCs

7.1.0 (2022-07-13)
------------------
* Added compatibility with SH2R Left

7.0.2 (2020-05-05)
------------------
* Bug fix in homing function

0.0.1 (2020-05-05)
------------------
* Here be Dragons
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
cmake_minimum_required(VERSION 3.5.1 FATAL_ERROR)
project(qbrobotics_driver VERSION 7.1.2 LANGUAGES CXX)
get_filename_component(API_PATH ../ ABSOLUTE)
if(EXISTS "${API_PATH}/serial/CMakeLists.txt")
message("-- [ ${PROJECT_NAME}] Serial folder found")
endif()
SET(CMAKE_PREFIX_PATH ${API_PATH}/serial)
message("-- [ ${PROJECT_NAME}] start compiling")
find_package(Serial REQUIRED)
add_library(qbrobotics_driver
STATIC # [SHARED | STATIC]
libs/research/src/qbrobotics_research_api.cpp
libs/research/src/qbrobotics_research_api_wrapper.cpp
libs/research/src/qbsofthand_research_api.cpp
libs/research/src/qbmove_research_api.cpp
libs/research/src/qbsofthand2_research_api.cpp
)
target_include_directories(qbrobotics_driver PUBLIC
$<BUILD_INTERFACE:${qbrobotics_driver_BINARY_DIR}/include>
$<BUILD_INTERFACE:${qbrobotics_driver_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
"$<BUILD_INTERFACE:${Serial_SOURCE_DIR}/include>"
)
target_include_directories(qbrobotics_driver
PUBLIC #TODO: make PRIVATE?
"$<BUILD_INTERFACE:${qbrobotics_driver_BINARY_DIR}/libs/research/include>"
"$<BUILD_INTERFACE:${qbrobotics_driver_SOURCE_DIR}/libs/research/include>"
PRIVATE
"$<BUILD_INTERFACE:${qbrobotics_driver_SOURCE_DIR}/libs/research/src>"
)
target_link_libraries(qbrobotics_driver PRIVATE
Serial::Serial
)
set_target_properties(qbrobotics_driver PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS NO
)
add_library(qbrobotics_driver::qbrobotics_driver ALIAS qbrobotics_driver)

install(DIRECTORY libs/research/include
DESTINATION include
)
install(TARGETS qbrobotics_driver EXPORT qbrobotics_driverTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
)
install(EXPORT qbrobotics_driverTargets
FILE qbrobotics_driverTargets.cmake
NAMESPACE qbrobotics_driver::
DESTINATION lib/cmake/qbrobotics_driver
)

include(CMakePackageConfigHelpers)
configure_package_config_file(qbrobotics_driverConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/qbrobotics_driverConfig.cmake
INSTALL_DESTINATION lib/cmake/qbrobotics_driver
)
write_basic_package_version_file(qbrobotics_driverConfigVersion.cmake
VERSION ${qbrobotics_driver_VERSION}
COMPATIBILITY SameMajorVersion
)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/qbrobotics_driverConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/qbrobotics_driverConfigVersion.cmake
DESTINATION lib/cmake/qbrobotics_driver
)

# Tests
set(TESTS false) # choose if enabling tests or not
if(TESTS)
enable_testing()
find_package(GTest REQUIRED CONFIG)

add_executable(qbrobotics_research_api_communication
tests/qbrobotics_research_api_communication.cpp
)
target_link_libraries(qbrobotics_research_api_communication PRIVATE
qbrobotics_driver::qbrobotics_driver
Serial::Serial
GTest::gtest
GTest::gmock
GTest::gtest_main
)
set_target_properties(qbrobotics_research_api_communication PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS NO
)
add_test(NAME qbrobotics_research_api_communication_tests
COMMAND qbrobotics_research_api_communication
)

add_executable(qbrobotics_research_api_wrapper_communication
tests/qbrobotics_research_api_wrapper_communication.cpp
)
target_link_libraries(qbrobotics_research_api_wrapper_communication PRIVATE
qbrobotics_driver::qbrobotics_driver
Serial::Serial
GTest::gtest
GTest::gmock
GTest::gtest_main
)
set_target_properties(qbrobotics_research_api_wrapper_communication PROPERTIES
CXX_STANDARD 14
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS NO
)
add_test(NAME qbrobotics_research_api_wrapper_communication_tests
COMMAND qbrobotics_research_api_wrapper_communication
)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# qbrobotics driver

C++ API to control qbrobotics devices (SoftHand Research, SoftHand2 Research and qbmove)

## INSTALLATION

### Research devices
This project has to be used as a __subdirectory__ together with the __Serial__ project.

Download the qbdevice-api-7.x.x project (downloadable from qbrobotics bitbucket repository) to have the complete project.

---
**NOTE**

In order to compile **STATIC** or **DYNAMIC** libraries just move to each of CMakeLists.txt files contained inside **qbrobotics-driver-internal** and **serial** folders and edit the **add_library** line in that file.

---
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/***
* Software License Agreement: BSD 3-Clause License
*
* Copyright (c) 2015-2021, qbrobotics®
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of conditions and the
* following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
* following disclaimer in the documentation and/or other materials provided with the distribution.
*
* * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef QBROBOTICS_DRIVER_QBMOVE_RESEARCH_API_H
#define QBROBOTICS_DRIVER_QBMOVE_RESEARCH_API_H

#include <qbrobotics_research_api/qbrobotics_research_api.h>

namespace qbrobotics_research_api {

class qbmoveResearch : public Device {
public:
class Params : public Device::Params {
public:
Params() = default;
~Params() override = default;

void initParams(const std::vector<int8_t> &param_buffer) override;
};

explicit qbmoveResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id);
explicit qbmoveResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id, bool init_params);
explicit qbmoveResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id, bool init_params, std::unique_ptr<Device::Params> params);
~qbmoveResearch() override = default;

int computeAndStoreMaximumStiffness();
int setPositionAndStiffnessReferences(int16_t position, int16_t stiffness);

int getParamRateLimiter();
int getParamRateLimiter(uint8_t &rate_limiter);

int setParamRateLimiter(uint8_t rate_limiter);
};

class qbmoveLegacyResearch : public qbmoveResearch {
public:
class Params : public qbmoveResearch::Params {
public:
Params() = default;
~Params() override = default;

void initParams(const std::vector<int8_t> &param_buffer) override;
};

explicit qbmoveLegacyResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id);
explicit qbmoveLegacyResearch(std::shared_ptr<Communication> communication, std::string name, std::string serial_port, uint8_t id, bool init_params);
~qbmoveLegacyResearch() override = default;

int getControlReferences(std::vector<int16_t> &control_references) override;
int setMotorStates(bool motor_state) override;

int getParamEncoderOffsets() override;
int getParamEncoderOffsets(std::vector<int16_t> &encoder_offsets) override;

int setParameter(uint16_t param_type, const std::vector<int8_t> &param_data) override;
int setParamId(uint8_t id) override;
int setParamEncoderOffsets(const std::vector<int16_t> &encoder_offsets) override;
int setParamZeros() override;
};

} // namespace qbrobotics_research_api

#endif // QBROBOTICS_DRIVER_QBMOVE_RESEARCH_API_H
Loading

0 comments on commit 31767f0

Please sign in to comment.