Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,6 @@
[submodule "ros2_workspace/src/adore_ros2_nodes/adore_odd_monitor"]
path = ros2_workspace/src/adore_ros2_nodes/odd_monitor
url = git@github.com:DLR-TS/adore_odd_monitor.git
[submodule "ros2_workspace/src/adore_libraries/adore_tridap"]
path = ros2_workspace/src/adore_libraries/adore_tridap
url = git@github.com:s0nofab1t/adore_tridap.git
1 change: 1 addition & 0 deletions ros2_workspace/src/adore_libraries/adore_tridap
Submodule adore_tridap added at 5bace5
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Dependencies
find_package(adore_map REQUIRED)
find_package(adore_tridap REQUIRED)

set(basic_map_loading_from_wfs_test_SRCS
basic_map_loading_from_wfs_test.cpp
helpers.hpp
)

add_executable(basic_map_loading_from_wfs_test ${basic_map_loading_from_wfs_test_SRCS})

# Include paths
target_include_directories(basic_map_loading_from_wfs_test
PUBLIC ${adore_map_INCLUDE_DIRS}
PUBLIC ${adore_tridap_INCLUDE_DIRS}
)

target_link_libraries(basic_map_loading_from_wfs_test
PUBLIC
adore_map::adore_map
adore_tridap::adore_tridap
)

install(TARGETS basic_map_loading_from_wfs_test
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Standalone Test Program for Downloading a Map from a WFS

---

To execute the test:

- Add the password in `config/r2s_wfs_config_bs.json`.
- If not done yet, build ADORe with `make build` in the project directory `adore`.
- Then, in the same directory, type `make cli`, and press return to start the ADORe CLI.
- Type `cd ros2_workspace/install/adore_map_downloader_test/bin`, and press return.
- Type `./basic_map_loading_from_wfs_test` (without any parameters), and press return.
- You should see the line "adore_nowcast_test: Nowcast query test completed successfully, good!" along the last few lines.

---
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

#include <iostream>
#include <string>
#include <curl/curl.h>
#include <filesystem>
#include "adore_map/map_downloader.hpp"
#include "adore_map/config.hpp"
#include "helpers.hpp"
#include "adore_tridap/map_downloader.hpp"
#include "adore_tridap/helpers.hpp"

using namespace adore::tridap;

/**
* @brief Test program to download map data from WFS and save as JSON files
Expand All @@ -41,7 +41,7 @@ int main( int argc, char* argv[] )
std::filesystem::remove_all( "cache" );

// Initialize the configuration from a properties file
Config cfg( "../../../src/adore_test_programs/adore_map_downloader_test/config/r2s_wfs_config_bs.json" );
ConfigMapDownloader cfg( "../../../src/adore_test_programs/adore_map_downloader_test/config/r2s_wfs_config_bs.json" );
// Use current directory for file cache and enable debug mode
MapDownloader map_downloader( cfg.server_url, cfg.username, cfg.password, cfg.project_name, cfg.target_srs,
cfg.bbox, "", true, true, true ); // curl_global_init, curl_global_cleanup, debug:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
find_package(PkgConfig REQUIRED)
pkg_check_modules(PROJ REQUIRED proj)
find_package(Eigen3 REQUIRED)
set(Eigen3_TARGETS Eigen3::Eigen)
find_package(OpenCV REQUIRED)

find_package(OpenDrive REQUIRED)
set(OpenDrive_TARGETS OpenDrive::OpenDrive)

find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIR})

find_package(caches REQUIRED)

if(TARGET adore_map)
target_link_libraries(adore_map PRIVATE ${PROJ_LIBRARIES} ${OpenCV_LIBS} ${CURL_LIBRARIES})
endif()


Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.8)
project(adore_nowcast_test VERSION 1.0.0 LANGUAGES CXX)

# C++20 strict mode
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# Dependencies
find_package(adore_tridap REQUIRED)

set(adore_nowcast_test_SRCS
adore_nowcast_test.cpp
)

add_executable(adore_nowcast_test ${adore_nowcast_test_SRCS})

# Include paths
target_include_directories(adore_nowcast_test
PUBLIC ${adore_nowcast_INCLUDE_DIRS}
)

target_link_libraries(adore_nowcast_test
PUBLIC
adore_tridap::adore_tridap
)

install(TARGETS adore_nowcast_test
EXPORT adore_nowcast_testTargets
RUNTIME DESTINATION bin
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Standalone Test Program for Querying the Nowcast Service (Work in Progress)

---

To execute the (preliminary) test:

- Add the password in `config/nowcast_test_config.json`.
- If not done yet, build ADORe with `make build` in the project directory `adore`.
- Then, in the same directory, type `make cli`, and press return to start the ADORe CLI.
- Type `cd ros2_workspace/install/adore_nowcast_test/bin`, and press return.
- Type `./adore_nowcast_test` (without any parameters), and press return.
- You should see the line "adore_nowcast_test: Nowcast query test completed successfully, good!" along the last few lines.

---
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include <iostream>
#include "adore_tridap/nowcast.hpp"
#include "adore_tridap/helpers.hpp"

using namespace adore::tridap;

// Main function
int main( int argc, char* argv[] )
{
if( argc != 1 )
{
std::cerr << "Usage: " << module_name( argv[0] ) << " (i.e., without parameters)." << std::endl;
exit( -1 );
}

// Clean up potential cache remnants from previous test runs
std::filesystem::remove_all( "cache" );

// Initialize the configuration from a properties file
ConfigNowcast cfg( "../../../src/adore_test_programs/adore_nowcast_test/config/nowcast_test_config.json" );
// Use current directory for file cache and enable debug mode
Nowcast nowcast( cfg.server_url, cfg.username, cfg.password, cfg.project_name, cfg.target_srs,
cfg.bbox, cfg.layer_name_nowcast, "", true, true, true ); // curl_global_init, curl_global_cleanup, debug:
// Since this test program is standalone, we can let the internal
// curl wrapper initialize, and later upon leaving scope, also
// cleanup curl globally

// First test the now() method to get the current time in ISO 8601 format
std::string current_time = Nowcast::now( true );
std::cout << module_name( argv[0] ) << ": Current time in ISO 8601 format: " << current_time << std::endl;

std::string test_time = "2019-08-02T18:00:00.000Z";
double thunderstorm_probability = nowcast.query( test_time );
std::cout << module_name( argv[0] ) << ": Thunderstorm probability for " << test_time << ": "
<< std::setprecision(17) << thunderstorm_probability << std::endl;
if( thunderstorm_probability < 0.0 )
{
std::cerr << module_name( argv[0] ) << ": Nowcast query failed for time " << test_time << std::endl;
exit( -1 );
} else if( thunderstorm_probability > 1.0 )
{
std::cerr << module_name( argv[0] ) << ": Nowcast query returned invalid probability value "
<< thunderstorm_probability << " for time " << test_time << std::endl;
exit( -1 );
} else if( thunderstorm_probability != 0.0016004316275939345 )
{
std::cerr << module_name( argv[0] ) << ": Nowcast query returned unexpected probability value "
<< thunderstorm_probability << " for time " << test_time << std::endl;
exit( -1 );
}
std::cout << module_name( argv[0] ) << ": Nowcast query returned expected probability value "
<< thunderstorm_probability << " for time " << test_time << std::endl;
std::cout << module_name( argv[0] ) << ": Nowcast query test completed successfully, good!"
<< std::endl << std::endl;
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url" : "https://ts.dlr.de/mumme-server/",
"project_name" : "in2action",
"target_srs" : "EPSG:4326",
"bbox" : [ 10.378418087832927, 44.4616700263095, 12.597656369082927, 46.6809083075595 ],
"username" : "adore-ts_reader",
"password" : "Enter Your Password Here",
"nowcast" : "in2action:thunderstorm_probability_sample"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@



Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Perhaps later:
#pkg-config
#libproj-dev
Loading