Skip to content

Commit

Permalink
Merge pull request #195 from jhu-dvrk/rc-2.2.1
Browse files Browse the repository at this point in the history
2.2.1
  • Loading branch information
adeguet1 authored Dec 29, 2023
2 parents 7dd6827 + a9f39e4 commit 356bac3
Show file tree
Hide file tree
Showing 41 changed files with 503 additions and 165 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
Change log
==========

2.2.1 (2023-12-29)
==================

* API changes:
* None
* Deprecated features:
* None
* New features:
* Shared files:
* Added `tool` mega suturecut needle drivers 400309 and 420309
* Added `console` for simulated PSM Si and ECM Si
* Added `io` for MTML on DQLA
* Console JSON: added configuration option "close-all-relays"
* Display explanation when powering fails on Si controllers
* Added CMake option to compile without Bluetooth for SUJ Si in simulated mode
* `dvrk-remove-logs.py`: added `-f` option to skip confirmation prompt
* Bug fixes:
* Fixes for Windows compilation
* Fixed crash on exit
* Fixed crash on PSM GUI direct control
* `dvrk-configuration-generator.py`
* Fixed boards IDs for PSMs and ECMs using DQLA controllers
* Better default for gripper

2.2.0 (2023-11-21)
==================

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# --- end cisst license ---

cmake_minimum_required(VERSION 3.10)
project (sawIntuitiveResearchKitAll VERSION 2.2.0)
project (sawIntuitiveResearchKitAll VERSION 2.2.1)

find_package (cisst REQUIRED)
include (${CISST_USE_FILE})
Expand Down
8 changes: 4 additions & 4 deletions applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# --- end cisst license ---

cmake_minimum_required (VERSION 3.10)
project (sawIntuitiveResearchKitApplications VERSION 2.2.0)
project (sawIntuitiveResearchKitApplications VERSION 2.2.1)

set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -41,7 +41,7 @@ set (REQUIRED_CISST_LIBRARIES cisstCommon
cisstQt)

# find cisst and make sure the required libraries have been compiled
find_package (cisst 1.2.0 REQUIRED ${REQUIRED_CISST_LIBRARIES})
find_package (cisst 1.2.1 REQUIRED ${REQUIRED_CISST_LIBRARIES})

if (cisst_FOUND_AS_REQUIRED)

Expand All @@ -55,9 +55,9 @@ if (cisst_FOUND_AS_REQUIRED)
endif ()

# saw components have been compiled within cisst, we should find them automatically
find_package (sawRobotIO1394 2.2.0 REQUIRED)
find_package (sawRobotIO1394 2.2.1 REQUIRED)
find_package (sawControllers 2.1.0 REQUIRED)
find_package (sawIntuitiveResearchKit 2.2.0 REQUIRED)
find_package (sawIntuitiveResearchKit 2.2.1 REQUIRED)
find_package (sawTextToSpeech 1.4.0 REQUIRED)

if (sawRobotIO1394_FOUND AND sawControllers_FOUND
Expand Down
4 changes: 2 additions & 2 deletions applications/config-generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
# --- end cisst license ---

cmake_minimum_required (VERSION 3.10)
project (sawIntuitiveResearchKitConfigGenerator VERSION 2.2.0)
project (sawIntuitiveResearchKitConfigGenerator VERSION 2.2.1)

# find cisst and make sure the required libraries have been compiled
find_package (cisst 1.2.0 REQUIRED ${REQUIRED_CISST_LIBRARIES})
find_package (cisst 1.2.1 REQUIRED ${REQUIRED_CISST_LIBRARIES})

if (cisst_FOUND_AS_REQUIRED)

Expand Down
107 changes: 61 additions & 46 deletions applications/config-generator/dvrk-config-generator.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion applications/gripper-calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# --- end cisst license ---

cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.10)

# create a list of required cisst libraries
set (REQUIRED_CISST_LIBRARIES cisstCommon
Expand Down
2 changes: 1 addition & 1 deletion applications/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<package>
<name>saw_intuitive_research_kit_applications</name>
<version>2.2.0</version>
<version>2.2.1</version>
<description>
sawIntuitiveResearchKit Application
</description>
Expand Down
4 changes: 2 additions & 2 deletions applications/remove-logs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
# --- end cisst license ---

cmake_minimum_required (VERSION 3.10)
project (sawIntuitiveResearchKitRemoveLogs VERSION 2.2.0)
project (sawIntuitiveResearchKitRemoveLogs VERSION 2.2.1)

# find cisst and make sure the required libraries have been compiled
find_package (cisst 1.2.0 REQUIRED ${REQUIRED_CISST_LIBRARIES})
find_package (cisst 1.2.1 REQUIRED ${REQUIRED_CISST_LIBRARIES})

if (cisst_FOUND_AS_REQUIRED)

Expand Down
94 changes: 56 additions & 38 deletions applications/remove-logs/dvrk-remove-logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Anton Deguet
#

import argparse
import glob
import os

Expand All @@ -17,41 +18,58 @@ def readable_size(size, decimal_point = 2):
return f'{size:.{decimal_point}f} {i}'


def remove_files(files, what):
if not files:
print(f'No {what} files found')
return

print(f'Removing {what} files')

total_size = 0
for file in files:
stats = os.stat(file)
total_size += stats.st_size

while True:
print(f'Total size of {what} file found {readable_size(total_size)}')
answer = input('[s] to show the files, [d] to delete them, [q] to quit\n')
if answer == 's':
for file in files:
stats = os.stat(file)
print(f'{file} {readable_size(stats.st_size)}')
elif answer == 'd':
for file in files:
print(f'Removing {file}')
os.remove(file)
return
elif answer == 'q':
return

# logs
files = glob.glob('./**/cisstLog.txt', recursive = True) \
+ glob.glob('./**/cisstLog-20*-*.txt', recursive = True)
remove_files(files, 'log')

# backups and extra files from calibration steps
files = glob.glob('./**/sawRobotIO*.xml-backup*', recursive = True) \
+ glob.glob('./**/*.json-backup-20*', recursive = True) \
+ glob.glob('./**/pot_calib_offsets_*.csv', recursive = True) \
+ glob.glob('./**/pot_calib_scales_*.csv', recursive = True)
remove_files(files, 'backup')
def remove_files(files, what, skip_prompt = False):
if not files:
print(f'No {what} files found')
return

print(f'Removing {what} files')

total_size = 0
for file in files:
stats = os.stat(file)
total_size += stats.st_size

while True:
answer = 'd'
if not skip_prompt:
print(f'Total size of {what} file found {readable_size(total_size)}')
answer = input('[s] to show the files, [d] to delete them, [q] to quit\n')
if answer == 's':
for file in files:
stats = os.stat(file)
print(f'{file} {readable_size(stats.st_size)}')
elif answer == 'd':
for file in files:
print(f'Removing {file}')
os.remove(file)
return
elif answer == 'q':
return

def main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
"-f",
"--force",
help = "force deletion without prompting user",
action = 'store_true'
)
args = parser.parse_args()
if not args.force:
print('You can use the command line argument -f, --force to avoid the prompts')

# logs
files = glob.glob('./**/cisstLog.txt', recursive = True) \
+ glob.glob('./**/cisstLog-20*-*.txt', recursive = True)
remove_files(files, 'log', skip_prompt = args.force)

# backups and extra files from calibration steps
files = glob.glob('./**/sawRobotIO*.xml-backup*', recursive = True) \
+ glob.glob('./**/*.json-backup-20*', recursive = True) \
+ glob.glob('./**/pot_calib_offsets_*.csv', recursive = True) \
+ glob.glob('./**/pot_calib_scales_*.csv', recursive = True)
remove_files(files, 'backup', skip_prompt = args.force)

if __name__ == "__main__":
main()
6 changes: 3 additions & 3 deletions applications/s-potentiometers-calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# --- end cisst license ---

cmake_minimum_required (VERSION 3.10)
project (sawIntuitiveResearchKitSPotentiometersCalibration VERSION 2.2.0)
project (sawIntuitiveResearchKitSPotentiometersCalibration VERSION 2.2.1)

# create a list of required cisst libraries
set (REQUIRED_CISST_LIBRARIES cisstCommon
Expand All @@ -21,7 +21,7 @@ set (REQUIRED_CISST_LIBRARIES cisstCommon
cisstParameterTypes)

# find cisst and make sure the required libraries have been compiled
find_package (cisst 1.2.0 REQUIRED ${REQUIRED_CISST_LIBRARIES})
find_package (cisst 1.2.1 REQUIRED ${REQUIRED_CISST_LIBRARIES})

if (cisst_FOUND_AS_REQUIRED)

Expand All @@ -35,7 +35,7 @@ if (cisst_FOUND_AS_REQUIRED)
endif ()

# saw components have been compiled within cisst, we should find them automatically
find_package (sawRobotIO1394 2.2.0 REQUIRED)
find_package (sawRobotIO1394 2.2.1 REQUIRED)

if (sawRobotIO1394_FOUND)

Expand Down
4 changes: 2 additions & 2 deletions applications/sd-card-updater/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
# --- end cisst license ---

cmake_minimum_required (VERSION 3.10)
project (sawIntuitiveResearchKitSDCardUpdater VERSION 2.2.0)
project (sawIntuitiveResearchKitSDCardUpdater VERSION 2.2.1)

# find cisst and make sure the required libraries have been compiled
find_package (cisst 1.2.0 REQUIRED ${REQUIRED_CISST_LIBRARIES})
find_package (cisst 1.2.1 REQUIRED ${REQUIRED_CISST_LIBRARIES})

if (cisst_FOUND_AS_REQUIRED)

Expand Down
87 changes: 55 additions & 32 deletions components/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# --- end cisst license ---

cmake_minimum_required (VERSION 3.10)
project (sawIntuitiveResearchKit VERSION 2.2.0)
project (sawIntuitiveResearchKit VERSION 2.2.1)

set (CMAKE_CXX_STANDARD 14)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -51,37 +51,47 @@ if (cisst_FOUND)
# catkin/ROS paths
cisst_set_output_path ()

# gattlib is not available on Windows
if (WIN32)
option (sawIntuitiveResearchKit_HAS_SUJ_Si "Compile code to support the SI SUJ over bluetooth (requires gattlib)" OFF)
else ()
option (sawIntuitiveResearchKit_HAS_SUJ_Si "Compile code to support the SI SUJ over bluetooth (requires gattlib)" ON)
endif ()

# external project for gattlib
include (ExternalProject)

set (SAW_GATTLIB_GIT_REPOSITORY https://github.com/jhu-cisst-external/gattlib)
ExternalProject_Add (gattlibExternal
PREFIX gattlib
GIT_REPOSITORY ${SAW_GATTLIB_GIT_REPOSITORY}
CMAKE_CACHE_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DGATTLIB_BUILD_EXAMPLES:BOOL=OFF
-DGATTLIB_BUILD_DOCS:BOOL=OFF
-DGATTLIB_PYTHON_INTERFACE:BOOL=OFF
-DGATTLIB_BUILD_EXAMPLES:BOOL=OFF
-DGATTLIB_SHARED_LIB:BOOL=ON
-DCMAKE_INSTALL_PREFIX:FILEPATH=${CMAKE_INSTALL_PREFIX}
UPDATE_COMMAND ""
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
)
set (gattlib_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
set (gattlib_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set (gattlib_LIBRARIES gattlib)
if (sawIntuitiveResearchKit_HAS_SUJ_Si)
include (ExternalProject)

set (SAW_GATTLIB_GIT_REPOSITORY https://github.com/jhu-cisst-external/gattlib)
ExternalProject_Add (gattlibExternal
PREFIX gattlib
GIT_REPOSITORY ${SAW_GATTLIB_GIT_REPOSITORY}
CMAKE_CACHE_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-DGATTLIB_BUILD_EXAMPLES:BOOL=OFF
-DGATTLIB_BUILD_DOCS:BOOL=OFF
-DGATTLIB_PYTHON_INTERFACE:BOOL=OFF
-DGATTLIB_BUILD_EXAMPLES:BOOL=OFF
-DGATTLIB_SHARED_LIB:BOOL=ON
-DCMAKE_INSTALL_PREFIX:FILEPATH=${CMAKE_INSTALL_PREFIX}
UPDATE_COMMAND ""
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
)
set (gattlib_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/include")
set (gattlib_LIBRARY_DIR "${CMAKE_INSTALL_PREFIX}/lib")
set (gattlib_LIBRARIES gattlib)

include_directories (${gattlib_INCLUDE_DIR})
link_directories (${gattlib_LIBRARY_DIR})
endif ()

# saw components configuration
include_directories (${sawTextToSpeech_INCLUDE_DIR}
${sawRobotIO1394_INCLUDE_DIR}
${sawControllers_INCLUDE_DIR}
${gattlib_INCLUDE_DIR})
${sawControllers_INCLUDE_DIR})

link_directories (${sawTextToSpeech_LIBRARY_DIR}
${sawRobotIO1394_LIBRARY_DIR}
${sawControllers_LIBRARY_DIR}
${gattlib_LIBRARY_DIR})
${sawControllers_LIBRARY_DIR})

# create/configure file for find_package (sawIntuitiveResearchKit)
set (sawIntuitiveResearchKit_INCLUDE_DIR
Expand All @@ -90,8 +100,13 @@ if (cisst_FOUND)
set (sawIntuitiveResearchKit_HEADER_DIR
"${sawIntuitiveResearchKit_SOURCE_DIR}/include/sawIntuitiveResearchKit")
set (sawIntuitiveResearchKit_LIBRARY_DIR
"${LIBRARY_OUTPUT_PATH}"
"${gattlib_LIBRARY_DIR}")
"${LIBRARY_OUTPUT_PATH}")

if (sawIntuitiveResearchKit_HAS_SUJ_Si)
set (sawIntuitiveResearchKit_LIBRARY_DIR
${sawIntuitiveResearchKit_LIBRARY_DIR}
"${gattlib_LIBRARY_DIR}")
endif ()

set (sawIntuitiveResearchKit_LIBRARIES sawIntuitiveResearchKit)

Expand Down Expand Up @@ -185,14 +200,22 @@ if (cisst_FOUND)
set_target_properties (sawIntuitiveResearchKit PROPERTIES
VERSION ${sawIntuitiveResearchKit_VERSION}
FOLDER "sawIntuitiveResearchKit")
add_dependencies (sawIntuitiveResearchKit gattlibExternal)
if (sawIntuitiveResearchKit_HAS_SUJ_Si)
add_dependencies (sawIntuitiveResearchKit gattlibExternal)
endif ()

# link against non cisst libraries and cisst components
target_link_libraries (sawIntuitiveResearchKit
${sawTextToSpeech_LIBRARIES}
${sawRobotIO1394_LIBRARIES}
${sawControllers_LIBRARIES}
${gattlib_LIBRARIES})
target_link_libraries (
sawIntuitiveResearchKit
${sawTextToSpeech_LIBRARIES}
${sawRobotIO1394_LIBRARIES}
${sawControllers_LIBRARIES})

if (sawIntuitiveResearchKit_HAS_SUJ_Si)
target_link_libraries (
sawIntuitiveResearchKit
${gattlib_LIBRARIES})
endif ()

# Install targets for headers and library
install (DIRECTORY
Expand Down
2 changes: 0 additions & 2 deletions components/code/mtsIntuitiveResearchKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,4 @@ mtsIntuitiveResearchKit::Logger::Logger(void)
void mtsIntuitiveResearchKit::Logger::Stop(void)
{
cmnLogger::Kill();
cmnLogger::RemoveChannel(*m_log_file_stream);
delete m_log_file_stream;
}
Loading

0 comments on commit 356bac3

Please sign in to comment.