This commit is contained in:
Oleg Kalachev
2022-11-05 01:29:22 +06:00
parent 06a4478b5e
commit 7a8b5585c1
3 changed files with 10 additions and 4 deletions

View File

@@ -230,6 +230,9 @@ target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBRARIES}
)
# Set Clover to default www page
set(ROSWWW_STATIC_DEFAULT ${PROJECT_NAME})
#############
## Install ##
#############

View File

@@ -19,4 +19,5 @@ catkin_install_python(PROGRAMS src/update
message(status "CATKIN_ENV: ${CATKIN_ENV}")
add_custom_target(roswww_static ALL
COMMAND ${CATKIN_ENV} ${CMAKE_CURRENT_SOURCE_DIR}/src/update)
COMMAND ${CMAKE_COMMAND} -E env ROSWWW_STATIC_DEFAULT=${ROSWWW_STATIC_DEFAULT}
${CATKIN_ENV} ${CMAKE_CURRENT_SOURCE_DIR}/src/update)

View File

@@ -22,9 +22,11 @@ rospack = rospkg.RosPack()
www = rospkg.get_ros_home() + '/www'
index_file = None # rospy.get_param('~index_file', None)
default_package = None # rospy.get_param('~default_package', None)
default_package = os.environ.get('ROSWWW_STATIC_DEFAULT') # rospy.get_param('~default_package', None)
print('roswww_static: destination directory:', www)
print('roswww_static: default package:', default_package)
print('roswww_static: putting symlinks to ', www)
shutil.rmtree(www, ignore_errors=True) # reset www directory content
os.mkdir(www)
@@ -35,7 +37,7 @@ index = '<h1>Packages list</h1>\n<ul>\n'
for name in packages:
path = rospack.get_path(name)
if os.path.exists(path + '/www'):
print('roswww_static: found www path for %s package', name)
print('roswww_static: found www path for package', name)
os.symlink(path + '/www', www + '/' + name)
index += '<li><a href="{name}/">{name}</a></li>'.format(name=name)