Skip to content

Commit 24300db

Browse files
committed
Added laser3d viewer
modifed inner_eigen so timed queries do not activate the cache
1 parent 113de45 commit 24300db

8 files changed

Lines changed: 695 additions & 89 deletions

File tree

api/dsr_inner_eigen_api.cpp

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ std::optional<Mat::RTMat> InnerEigenAPI::get_transformation_matrix(const std::st
2222
{
2323
if( not DSR::DSRGraph::is_valid_edge_type(edge_type))
2424
return {};
25+
const bool use_cache = (timestamp == 0);
2526
KeyTransform key = std::make_tuple(dest, orig, edge_type);
26-
if( auto it = cache.find(key) ; it != cache.end())
27-
return it->second;
28-
else
27+
if(use_cache)
28+
if( auto it = cache.find(key) ; it != cache.end())
29+
return it->second;
2930
{
3031
Mat::RTMat atotal(Mat::RTMat::Identity());
3132
Mat::RTMat btotal(Mat::RTMat::Identity());
@@ -59,7 +60,8 @@ std::optional<Mat::RTMat> InnerEigenAPI::get_transformation_matrix(const std::st
5960
if( auto rtmat = rt->get_edge_RT_as_rtmat(edge_rt.value(), timestamp); rtmat.has_value())
6061
{
6162
atotal = rtmat.value() * atotal;
62-
node_map[p_node.value().id()].push_back(key); // update node cache reference
63+
if(use_cache)
64+
node_map[p_node.value().id()].push_back(key); // update node cache reference
6365
a = p_node.value();
6466
}
6567
else return {};
@@ -79,7 +81,8 @@ std::optional<Mat::RTMat> InnerEigenAPI::get_transformation_matrix(const std::st
7981
if( auto rtmat = rt->get_edge_RT_as_rtmat(edge_rt.value(), timestamp); rtmat.has_value())
8082
{
8183
btotal = rtmat.value() * btotal;
82-
node_map[p_node.value().id()].push_back(key); // update node cache reference
84+
if(use_cache)
85+
node_map[p_node.value().id()].push_back(key); // update node cache reference
8386
b = p_node.value();
8487
}
8588
else
@@ -111,8 +114,11 @@ std::optional<Mat::RTMat> InnerEigenAPI::get_transformation_matrix(const std::st
111114
{
112115
atotal = a_rtmat.value() * atotal;
113116
btotal = b_rtmat.value() * btotal;
114-
node_map[p_node.value().id()].push_back(key); // update node cache reference
115-
node_map[q_node.value().id()].push_back(key); // update node cache reference
117+
if(use_cache)
118+
{
119+
node_map[p_node.value().id()].push_back(key); // update node cache reference
120+
node_map[q_node.value().id()].push_back(key); // update node cache reference
121+
}
116122
a = p_node.value();
117123
b = q_node.value();
118124
}
@@ -125,12 +131,15 @@ std::optional<Mat::RTMat> InnerEigenAPI::get_transformation_matrix(const std::st
125131
}
126132
}
127133
// update node cache reference
128-
node_map[bn.value().id()].push_back(key);
129-
node_map[an.value().id()].push_back(key);
134+
if(use_cache)
135+
{
136+
node_map[bn.value().id()].push_back(key);
137+
node_map[an.value().id()].push_back(key);
138+
}
130139

131-
// update cache
132140
auto ret = btotal.inverse() * atotal;
133-
cache[key] = ret;
141+
if(use_cache)
142+
cache[key] = ret;
134143
return ret;
135144
}
136145
}

core/include/dsr/core/types/type_checking/dsr_attr_name.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ REGISTER_TYPE(obj_checked, bool, false)
195195
REGISTER_TYPE(average_size, std::reference_wrapper<const std::string>, false)
196196
REGISTER_TYPE(is_an_obstacle, bool, false)
197197
REGISTER_TYPE(room_id, uint64_t, false)
198+
198199
/*
199200
* Object affordances
200201
*
201202
**/
202203
REGISTER_TYPE(aff_x_pos, std::reference_wrapper<const std::vector<float>>, true)
203204
REGISTER_TYPE(aff_y_pos, std::reference_wrapper<const std::vector<float>>, true)
204-
205205
REGISTER_TYPE(aff_interacting, bool, true)
206206

207207

@@ -309,8 +309,8 @@ REGISTER_TYPE(ultrasound_y_pos, std::reference_wrapper<const std::vector<float>>
309309
* */
310310
REGISTER_TYPE(delimiting_polygon_x, std::reference_wrapper<const std::vector<float>>, false);
311311
REGISTER_TYPE(delimiting_polygon_y, std::reference_wrapper<const std::vector<float>>, false);
312+
REGISTER_TYPE(room_height, float, false);
312313
REGISTER_TYPE(room_is_oriented, bool, false);
313-
REGISTER_TYPE(rotation, float, false);
314314
REGISTER_TYPE(center_x, float, false);
315315
REGISTER_TYPE(center_y, float, false);
316316
REGISTER_TYPE(corner1, std::reference_wrapper<const std::vector<float>>, false);

core/include/dsr/core/types/type_checking/dsr_node_type.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ REGISTER_NODE_TYPE(pose)
4343
REGISTER_NODE_TYPE(laser)
4444
REGISTER_NODE_TYPE(ultrasound)
4545
REGISTER_NODE_TYPE(camera)
46+
REGISTER_NODE_TYPE(semantic_grid)
4647
REGISTER_NODE_TYPE(imu)
4748
REGISTER_NODE_TYPE(slam_device)
4849
REGISTER_NODE_TYPE(object)

core/rtps/dsrparticipant.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ std::tuple<bool, eprosima::fastdds::dds::DomainParticipant*> DSRParticipant::ini
6565
PParam.transport().user_transports.push_back(shm_transport);
6666

6767
auto udp_transport = std::make_shared<UDPv4TransportDescriptor>();
68-
udp_transport->maxMessageSize = 65000;
68+
udp_transport->maxMessageSize = 65536;
6969
udp_transport->interface_allowlist.emplace_back("127.0.0.1");
7070
PParam.transport().user_transports.push_back(udp_transport);
7171
} else {
7272
auto udp_transport = std::make_shared<UDPv4TransportDescriptor>();
73-
udp_transport->maxMessageSize = 65000;
73+
udp_transport->maxMessageSize = 65536;
7474
for (const auto& ip : host_ipv4_interfaces()) {
7575
udp_transport->interface_allowlist.emplace_back(ip);
7676
}
@@ -90,7 +90,7 @@ std::tuple<bool, eprosima::fastdds::dds::DomainParticipant*> DSRParticipant::ini
9090
PParam.wire_protocol().builtin.discovery_config.leaseDuration_announcementperiod =
9191
eprosima::fastdds::dds::Duration_t(3, 0);
9292

93-
eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Info);
93+
eprosima::fastdds::dds::Log::SetVerbosity(eprosima::fastdds::dds::Log::Error);
9494

9595
m_listener = std::make_unique<ParticpantListener>(std::move(fn));
9696

gui/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif()
3333

3434
message(STATUS ${qt3d_required} " " ${qt3d_viewer_headers} " " ${qt3d_libs} " " ${qt3d_viewer_sources})
3535

36-
find_package(Qt6 COMPONENTS Widgets OpenGL Xml ${qt3d_required} REQUIRED)
36+
find_package(Qt6 COMPONENTS Widgets OpenGL OpenGLWidgets Xml ${qt3d_required} REQUIRED)
3737
find_package(Eigen3 3.3 REQUIRED NO_MODULE)
3838
find_package(OpenSceneGraph REQUIRED COMPONENTS osg osgDB osgGA)
3939
find_package(cppitertools)
@@ -90,7 +90,7 @@ target_sources(dsr_gui
9090

9191
target_link_libraries(dsr_gui
9292
PRIVATE
93-
Qt6::Widgets Qt6::Xml
93+
Qt6::Widgets Qt6::Xml Qt6::OpenGLWidgets
9494
Eigen3::Eigen
9595
fastcdr
9696
osgViewer osgDB osgGA OpenThreads

0 commit comments

Comments
 (0)