|
lanelet2_map_server v1.2.3
|
#include <lanelet2_map_server.hpp>
Public Member Functions | |
| Lanelet2MapServer () | |
| Creates the Lanelet2 map server node and declares its parameters. | |
Private Member Functions | |
| template<typename T > | |
| bool | declareAndLoadParameter (const std::string &name, T ¶m, const std::string &description, const bool add_to_auto_reconfigurable_params=true, const bool is_required=false, const bool read_only=false, const std::optional< double > &from_value=std::nullopt, const std::optional< double > &to_value=std::nullopt, const std::optional< double > &step_value=std::nullopt, const std::string &additional_constraints="") |
| Declares and loads a ROS parameter. | |
| rcl_interfaces::msg::SetParametersResult | parametersCallback (const std::vector< rclcpp::Parameter > ¶meters) |
| Handles reconfiguration when a parameter value is changed. | |
| void | loadMapContents () |
| Loads the configured map file and caches its serialized contents. | |
| void | unsetMapParameters () |
| Clears map-specific parameters after an invalid or unloaded map state. | |
| void | updateMapParameters () |
| Writes the current map state into this node's exported ROS parameters. | |
| void | setup () |
| Sets up timers, callbacks, publishers, and initial map loading. | |
| void | find_available_maps (const std::string &directory, std::vector< Lanelet2MapMeta > &maps) const |
| Recursively scans a directory for available Lanelet2 map files. | |
| void | derive_map_meta (Lanelet2MapMeta &map_meta) const |
| Fills the derived metadata fields for a discovered map. | |
| bool | deriveOriginFromMap (const std::string &map_filepath, double &origin_lat, double &origin_lon) const |
| Derives a south-west origin latitude and longitude from a Lanelet2 map file. | |
| bool | map_sanity_check (std::string map_filepath, double origin_lat, double origin_lon) const |
| Tries to load a map with the provided origin to verify that it is usable. | |
| void | pub_tf () const |
| Publishes the static transform from the derived UTM frame to the map frame. | |
| void | navSatFixCallback (const sensor_msgs::msg::NavSatFix::SharedPtr msg) |
| Stores the latest GNSS fix for automatic map selection. | |
| void | automaticMapUpdateTimerCallback () |
| Periodically reevaluates the best map when automatic selection is enabled. | |
Static Private Member Functions | |
| static void | derive_utm_zone (const double latitude, const double longitude, int &zone, bool &northp) |
| Derives the UTM zone and hemisphere from a geographic position. | |
Private Attributes | |
| std::vector< std::tuple< std::string, std::function< void(const rclcpp::Parameter &)> > > | auto_reconfigurable_params_ |
| Auto-reconfigurable parameters for dynamic reconfiguration. | |
| OnSetParametersCallbackHandle::SharedPtr | parameters_callback_ |
| Callback handle for dynamic parameter reconfiguration. | |
| rclcpp::TimerBase::SharedPtr | one_shot_timer_ |
| rclcpp::TimerBase::SharedPtr | automatic_map_timer_ |
| bool | use_automatic_map_selection_ = false |
| std::string | map_directory_ = "/data/maps/default-maps" |
| std::vector< Lanelet2MapMeta > | available_maps_ |
| std::string | map_filepath_ |
| std::string | map_frame_id_ = "map" |
| std::string | map_contents_ |
| double | origin_lat_ |
| double | origin_lon_ |
| bool | origin_lat_set_ = false |
| bool | origin_lon_set_ = false |
| std::shared_ptr< tf2_ros::StaticTransformBroadcaster > | tf_static_broadcaster_ |
| rclcpp::Subscription< sensor_msgs::msg::NavSatFix >::SharedPtr | navsat_subscription_ |
| double | current_latitude_ = std::numeric_limits<double>::quiet_NaN() |
| double | current_longitude_ = std::numeric_limits<double>::quiet_NaN() |
| bool | gps_fix_received_ = false |
Definition at line 40 of file lanelet2_map_server.hpp.
| Lanelet2MapServer::Lanelet2MapServer | ( | ) |
Creates the Lanelet2 map server node and declares its parameters.
Definition at line 16 of file lanelet2_map_server.cpp.
|
private |
Periodically reevaluates the best map when automatic selection is enabled.
Definition at line 389 of file lanelet2_map_server.cpp.
|
private |
Declares and loads a ROS parameter.
| name | name |
| param | parameter variable to load into |
| description | description |
| add_to_auto_reconfigurable_params | enable reconfiguration of parameter |
| is_required | whether failure to load parameter will stop node |
| read_only | set parameter to read-only |
| from_value | parameter range minimum |
| to_value | parameter range maximum |
| step_value | parameter range step |
| additional_constraints | additional constraints description |
Definition at line 37 of file lanelet2_map_server.cpp.
|
private |
Fills the derived metadata fields for a discovered map.
| map_meta | metadata entry whose geographic bounds and size are updated |
Definition at line 328 of file lanelet2_map_server.cpp.
|
staticprivate |
Derives the UTM zone and hemisphere from a geographic position.
| latitude | latitude in degrees |
| longitude | longitude in degrees |
| zone | output UTM zone number |
| northp | output hemisphere flag, true for northern hemisphere |
Definition at line 479 of file lanelet2_map_server.cpp.
|
private |
Derives a south-west origin latitude and longitude from a Lanelet2 map file.
| map_filepath | path to the map file |
| origin_lat | output latitude of the derived south-west origin |
| origin_lon | output longitude of the derived south-west origin |
true if the origin could be derived from the map bounds Definition at line 283 of file lanelet2_map_server.cpp.
|
private |
Recursively scans a directory for available Lanelet2 map files.
| directory | root directory to search |
| maps | output vector that receives discovered map metadata |
Definition at line 301 of file lanelet2_map_server.cpp.
|
private |
Loads the configured map file and caches its serialized contents.
Definition at line 440 of file lanelet2_map_server.cpp.
|
private |
Tries to load a map with the provided origin to verify that it is usable.
| map_filepath | path to the map file |
| origin_lat | latitude used for projection |
| origin_lon | longitude used for projection |
true if the map passes the sanity check Definition at line 467 of file lanelet2_map_server.cpp.
|
private |
Stores the latest GNSS fix for automatic map selection.
| msg | incoming GPS fix message |
Definition at line 383 of file lanelet2_map_server.cpp.
|
private |
Handles reconfiguration when a parameter value is changed.
| parameters | parameters |
Definition at line 113 of file lanelet2_map_server.cpp.
|
private |
Publishes the static transform from the derived UTM frame to the map frame.
Definition at line 484 of file lanelet2_map_server.cpp.
|
private |
Sets up timers, callbacks, publishers, and initial map loading.
Definition at line 234 of file lanelet2_map_server.cpp.
|
private |
Clears map-specific parameters after an invalid or unloaded map state.
Definition at line 457 of file lanelet2_map_server.cpp.
|
private |
Writes the current map state into this node's exported ROS parameters.
Definition at line 450 of file lanelet2_map_server.cpp.
|
private |
Auto-reconfigurable parameters for dynamic reconfiguration.
Definition at line 168 of file lanelet2_map_server.hpp.
|
private |
Definition at line 176 of file lanelet2_map_server.hpp.
|
private |
Definition at line 181 of file lanelet2_map_server.hpp.
|
private |
Definition at line 192 of file lanelet2_map_server.hpp.
|
private |
Definition at line 193 of file lanelet2_map_server.hpp.
|
private |
Definition at line 194 of file lanelet2_map_server.hpp.
|
private |
Definition at line 184 of file lanelet2_map_server.hpp.
|
private |
Definition at line 180 of file lanelet2_map_server.hpp.
|
private |
Definition at line 182 of file lanelet2_map_server.hpp.
|
private |
Definition at line 183 of file lanelet2_map_server.hpp.
|
private |
Definition at line 191 of file lanelet2_map_server.hpp.
|
private |
Definition at line 175 of file lanelet2_map_server.hpp.
|
private |
Definition at line 185 of file lanelet2_map_server.hpp.
|
private |
Definition at line 187 of file lanelet2_map_server.hpp.
|
private |
Definition at line 186 of file lanelet2_map_server.hpp.
|
private |
Definition at line 188 of file lanelet2_map_server.hpp.
|
private |
Callback handle for dynamic parameter reconfiguration.
Definition at line 173 of file lanelet2_map_server.hpp.
|
private |
Definition at line 190 of file lanelet2_map_server.hpp.
|
private |
Definition at line 178 of file lanelet2_map_server.hpp.