Skip to content
Snippets Groups Projects
Commit dc85d8b1 authored by Fabian Reister's avatar Fabian Reister
Browse files

fix: moving query description inside loop. otherwise, the timestamp will never be updated

parent 99ed3c56
No related branches found
No related tags found
1 merge request!28Draft: Dev -> Main
...@@ -174,13 +174,14 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p ...@@ -174,13 +174,14 @@ namespace armarx::navigation::components::dynamic_distance_to_obstacle_costmap_p
bool bool
Component::readStaticCostmap() Component::readStaticCostmap()
{ {
const memory::client::costmap::Reader::Query query{
.providerName = properties.staticCostmap.providerName,
.name = properties.staticCostmap.name,
.timestamp = armarx::core::time::Clock::Now()};
while (true) while (true)
{ {
const memory::client::costmap::Reader::Query query{
.providerName = properties.staticCostmap.providerName,
.name = properties.staticCostmap.name,
.timestamp = armarx::core::time::Clock::Now()};
const auto result = costmapReader.query(query); const auto result = costmapReader.query(query);
if (result.costmap.has_value()) if (result.costmap.has_value())
......
...@@ -84,10 +84,6 @@ namespace armarx::navigation::server::scene_provider ...@@ -84,10 +84,6 @@ namespace armarx::navigation::server::scene_provider
ARMARX_INFO << objects->getSize() << " objects in the scene"; ARMARX_INFO << objects->getSize() << " objects in the scene";
ARMARX_INFO << "Retrieving costmap in memory"; ARMARX_INFO << "Retrieving costmap in memory";
const memory::client::costmap::Reader::Query query{.providerName =
config.staticCostmapProviderName,
.name = config.staticCostmapName,
.timestamp = armarx::Clock::Now()};
ARMARX_TRACE; ARMARX_TRACE;
...@@ -96,10 +92,17 @@ namespace armarx::navigation::server::scene_provider ...@@ -96,10 +92,17 @@ namespace armarx::navigation::server::scene_provider
// waiting for static costmap to become available // waiting for static costmap to become available
while (true) while (true)
{ {
const memory::client::costmap::Reader::Query query{
.providerName = config.staticCostmapProviderName,
.name = config.staticCostmapName,
.timestamp = armarx::Clock::Now()};
if (const memory::client::costmap::Reader::Result costmap = if (const memory::client::costmap::Reader::Result costmap =
srv.costmapReader->query(query)) srv.costmapReader->query(query))
{ {
ARMARX_CHECK(costmap.costmap.has_value()); ARMARX_CHECK(costmap.costmap.has_value());
ARMARX_INFO << "Static costmap available.";
return costmap.costmap.value(); return costmap.costmap.value();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment