![]() |
Galaxis Codebase
1.0.0
Team Galaxis software stack for the Carolo Cup 2023 - ROS2 based software
|
#include <MapDataLayer.hpp>
Public Member Functions | |
| MapDataLayer () | |
| MapDataLayer (int amountOfThreads) | |
| ~MapDataLayer () | |
| void | init () |
| void | clear () |
| void | enableSimulationMode () |
| void | setLookupWindowSizeCMWidth (int value) |
| void | setLookupWindowSizeCMHeight (int value) |
| void | setCellThresholdRGBValue (uint8_t value) |
| void | setCellThresholdExtract (uint8_t value) |
| void | setCellLineDecreasePerView (uint8_t value) |
| void | setCellLineIncreasePerView (uint8_t value) |
| void | setLaneImageConversionFactor (float factor) |
| void | setObstaclePositionDiffForRerecognition (float diff) |
| void | setObstacleTrackTimeDuration (int sec, int nsec) |
| bool | isInImageIgnoreField (Vector2f p_position, unsigned int p_maxImageX) |
| void | updateMap (const sensor_msgs::msg::Image::ConstSharedPtr &laneDetectionSPtr, Vector2f currentAbsoluteCarPositionCM, double currentAbsoluteOrientation) |
| std::shared_ptr< LinesObject< int16_t > > | getLineObject (Vector2f absolutePositionCM, float lookBehindPosOffsetCM, double absoluteOrientation, Vector2i windowSize) |
| std::shared_ptr< std::vector< StaticObstacle > > | getObstacles (rclcpp::Time const ×tamp, bool removeOld=true) |
| void | addOrUpdateStaticObstacle (ObstacleType const &p_obstacle, Vector2f absolutePositionCM, double currentOrientation, rclcpp::Time const ×tamp) |
| MapDataLayer () | |
| MapDataLayer (int amountOfThreads) | |
| ~MapDataLayer () | |
| void | init () |
| void | clear () |
| void | updateMap (visualization_msgs::msg::Marker::SharedPtr laneDetectionSPtr, char laneType) |
| std::shared_ptr< LinesObject< int16_t > > | getLineObject (Vector2f absolutePositionCM, float absoluteOrientation, Vector2i windowSize, Vector2i &effectiveWindowSize) |
Public Attributes | |
| int | m_lookupWindowSizeCMWidth = 160 |
| int | m_lookupWindowSizeCMHeight = 150 |
| uint8_t | m_cellThresholdRGBValue = 80 |
| uint8_t | m_cellThresholdExtract = 99 |
| uint8_t | m_cellLineDecreasePerView = 100 |
| uint8_t | m_cellLineIncreasePerView = 100 |
| float | m_laneImagePixelToPositionConversionFactor = 1.5625f |
| float | m_obstaclePositionDiffForRerecognitionCM = 40.0 |
| std::shared_ptr< std::vector< StaticObstacle > > | m_staticObstacleVecSPtr |
| rclcpp::Duration | m_obstacleKeepDuration |
Private Types | |
| typedef std::array< MapCell, MAP_SIZE > | ColumnMapArray |
| typedef std::array< ColumnMapArray, MAP_SIZE > | MapArray |
| typedef std::array< MapCell, MAP_SIZE > | ColumnMapArray |
| typedef std::array< ColumnMapArray, MAP_SIZE > | MapArray |
Private Member Functions | |
| void | preprocessPoints (const sensor_msgs::msg::Image::ConstSharedPtr &laneDetectionSPtr, Vector2f const ¤tPositionCM, int arrayOffsetStartIndex, int arrayOffsetEndIndex, double currentAbsoluteOrientation) |
| void | updateCell (MapCell const &cellUpdate, Vector2i position) |
| void | decreaseStepCell (MapCell *cellPtr) |
| float | checkPositionRelativeToEdge (int x1, int y1, int x2, int y2, int xp, int yp) |
| void | iterateThroughMap (int arrayStartX, int arrayEndX, int arrayStartY, int arrayEndY, Vector2i const &absoluteCarPosition, std::array< Vector2f, 4 > const &windowEdges) |
| void | updateCell (Vector2i position, char laneType) |
| void | iterateThroughMap (int arrayStartX, int arrayEndX, int arrayStartY, int arrayEndY, Vector2i const &absoluteCarPosition) |
Private Attributes | |
| bool | m_simulationMode = false |
| boost::asio::thread_pool | m_threadPool |
| int | m_amountOfThreads |
| std::shared_mutex | m_sharedThreadMutex |
| MapArray | m_data |
| Vector2f | m_mapSize |
| std::mutex | m_mapMutex |
| std::atomic< uint32_t > | m_updateStep = 0 |
| Vector2f | m_absoluteCarPositionOffset |
| std::shared_ptr< LinesObject< int16_t > > | m_linesObjectSPtr |
| geometry_msgs::msg::Point | m_lastPointLeftLane |
| bool | m_lastPointLeftLaneUsable = false |
| geometry_msgs::msg::Point | m_lastPointCenterLane |
| bool | m_lastPointCenterLaneUsable = false |
| geometry_msgs::msg::Point | m_lastPointRightLane |
| bool | m_lastPointRightLaneUsable = false |
Definition at line 55 of file MapDataLayer.hpp.
|
private |
Definition at line 34 of file MapDataLayer.hpp.
|
private |
Definition at line 56 of file MapDataLayer.hpp.
|
private |
Definition at line 35 of file MapDataLayer.hpp.
|
private |
Definition at line 57 of file MapDataLayer.hpp.
| MapDataLayer::MapDataLayer | ( | ) |
Definition at line 18 of file MapDataLayer.cpp.
References init(), and m_amountOfThreads.

| MapDataLayer::MapDataLayer | ( | int | amountOfThreads = 4 | ) |
Definition at line 12 of file MapDataLayer.cpp.
References init(), and m_amountOfThreads.

| MapDataLayer::~MapDataLayer | ( | ) |
Definition at line 24 of file MapDataLayer.cpp.
References m_threadPool.
| MapDataLayer::MapDataLayer | ( | ) |
| MapDataLayer::MapDataLayer | ( | int | amountOfThreads | ) |
| MapDataLayer::~MapDataLayer | ( | ) |
| void MapDataLayer::addOrUpdateStaticObstacle | ( | ObstacleType const & | p_obstacle, |
| Vector2f | absolutePositionCM, | ||
| double | currentOrientation, | ||
| rclcpp::Time const & | timestamp | ||
| ) |
Definition at line 391 of file MapDataLayer.cpp.
References m_obstaclePositionDiffForRerecognitionCM, and m_staticObstacleVecSPtr.
Referenced by AutoPilotNode::on_obstacle_callback().

|
private |
Definition at line 328 of file MapDataLayer.cpp.
Referenced by iterateThroughMap().

| void MapDataLayer::clear | ( | ) |
| void MapDataLayer::clear | ( | ) |
Definition at line 41 of file MapDataLayer.cpp.
References m_data.
Referenced by init().

|
inlineprivate |
Definition at line 226 of file MapDataLayer.cpp.
References MapCell::centerLine, MapCell::lastUpdateStep, MapCell::leftLine, m_cellLineDecreasePerView, m_updateStep, and MapCell::rightLine.
| void MapDataLayer::enableSimulationMode | ( | ) |
Definition at line 48 of file MapDataLayer.cpp.
References m_simulationMode.
Referenced by AutoPilotNode::AutoPilotNode().

| std::shared_ptr< LinesObject< int16_t > > MapDataLayer::getLineObject | ( | Vector2f | absolutePositionCM, |
| float | absoluteOrientation, | ||
| Vector2i | windowSize, | ||
| Vector2i & | effectiveWindowSize | ||
| ) |
Definition at line 133 of file MapDataLayer.cpp.
References map::utils::getMax(), map::utils::getMin(), iterateThroughMap(), galaxis::utils::log_warning(), m_absoluteCarPositionOffset, m_linesObjectSPtr, m_mapMutex, and m_mapSize.

| std::shared_ptr< LinesObject< int16_t > > MapDataLayer::getLineObject | ( | Vector2f | absolutePositionCM, |
| float | lookBehindPosOffsetCM, | ||
| double | absoluteOrientation, | ||
| Vector2i | windowSize | ||
| ) |
Definition at line 250 of file MapDataLayer.cpp.
References map::utils::getMax(), map::utils::getMin(), iterateThroughMap(), galaxis::utils::log_warning(), galaxis::autopilot::lookupLookBehindCarCM, m_absoluteCarPositionOffset, m_amountOfThreads, m_linesObjectSPtr, m_mapMutex, m_mapSize, m_sharedThreadMutex, and m_threadPool.
Referenced by AutoPilot::get_lane_centers(), LaneDetectionGT::loop(), and AutoPilotNode::send_full_map_debug_image().


| std::shared_ptr< std::vector< StaticObstacle > > MapDataLayer::getObstacles | ( | rclcpp::Time const & | timestamp, |
| bool | removeOld = true |
||
| ) |
Definition at line 375 of file MapDataLayer.cpp.
References m_obstacleKeepDuration, and m_staticObstacleVecSPtr.
Referenced by AutoPilot::get_lane_blocked(), and AutoPilotNode::send_map_debug_image().

| void MapDataLayer::init | ( | ) |
| void MapDataLayer::init | ( | ) |
Definition at line 28 of file MapDataLayer.cpp.
References clear(), galaxis::utils::log(), m_absoluteCarPositionOffset, m_amountOfThreads, m_linesObjectSPtr, m_mapSize, m_staticObstacleVecSPtr, and MAP_SIZE.
Referenced by MapDataLayer().


| bool MapDataLayer::isInImageIgnoreField | ( | Vector2f | p_position, |
| unsigned int | p_maxImageX | ||
| ) |
Definition at line 115 of file MapDataLayer.cpp.
References galaxis::autopilot::imageIgnoreFieldArray.
Referenced by preprocessPoints().

|
private |
Definition at line 213 of file MapDataLayer.cpp.
References MapCell::centerLine, MapCell::leftLine, m_data, m_linesObjectSPtr, and MapCell::rightLine.
|
private |
Definition at line 334 of file MapDataLayer.cpp.
References MapCell::centerLine, checkPositionRelativeToEdge(), MapCell::lastUpdateStep, MapCell::leftLine, m_cellThresholdExtract, m_data, m_linesObjectSPtr, m_sharedThreadMutex, m_updateStep, and MapCell::rightLine.
Referenced by getLineObject().


|
private |
Definition at line 142 of file MapDataLayer.cpp.
References MapCell::centerLine, galaxis::autopilot::imageCLinePixelByteIndex, galaxis::autopilot::imageLLinePixelByteIndex, galaxis::autopilot::imageRLinePixelByteIndex, isInImageIgnoreField(), MapCell::leftLine, m_absoluteCarPositionOffset, m_data, m_laneImagePixelToPositionConversionFactor, m_sharedThreadMutex, m_simulationMode, MapCell::rightLine, and updateCell().
Referenced by updateMap().


| void MapDataLayer::setCellLineDecreasePerView | ( | uint8_t | value | ) |
Definition at line 66 of file MapDataLayer.cpp.
References m_cellLineDecreasePerView.
Referenced by AutoPilotNode::new_parameters_callback().

| void MapDataLayer::setCellLineIncreasePerView | ( | uint8_t | value | ) |
Definition at line 69 of file MapDataLayer.cpp.
References m_cellLineIncreasePerView.
Referenced by AutoPilotNode::new_parameters_callback().

| void MapDataLayer::setCellThresholdExtract | ( | uint8_t | value | ) |
Definition at line 63 of file MapDataLayer.cpp.
References m_cellThresholdExtract.
Referenced by AutoPilotNode::new_parameters_callback().

| void MapDataLayer::setCellThresholdRGBValue | ( | uint8_t | value | ) |
Definition at line 60 of file MapDataLayer.cpp.
References m_cellThresholdRGBValue.
Referenced by AutoPilotNode::new_parameters_callback().

| void MapDataLayer::setLaneImageConversionFactor | ( | float | factor | ) |
Definition at line 72 of file MapDataLayer.cpp.
References m_laneImagePixelToPositionConversionFactor.
Referenced by AutoPilotNode::AutoPilotNode().

| void MapDataLayer::setLookupWindowSizeCMHeight | ( | int | value | ) |
Definition at line 54 of file MapDataLayer.cpp.
References m_lookupWindowSizeCMHeight.
Referenced by AutoPilotNode::new_parameters_callback().

| void MapDataLayer::setLookupWindowSizeCMWidth | ( | int | value | ) |
Definition at line 51 of file MapDataLayer.cpp.
References m_lookupWindowSizeCMWidth.
Referenced by AutoPilotNode::new_parameters_callback().

| void MapDataLayer::setObstaclePositionDiffForRerecognition | ( | float | diff | ) |
Definition at line 75 of file MapDataLayer.cpp.
References m_obstaclePositionDiffForRerecognitionCM.
Referenced by AutoPilotNode::new_parameters_callback().

| void MapDataLayer::setObstacleTrackTimeDuration | ( | int | sec, |
| int | nsec | ||
| ) |
Definition at line 78 of file MapDataLayer.cpp.
References m_obstacleKeepDuration.
Referenced by AutoPilotNode::new_parameters_callback().

Definition at line 181 of file MapDataLayer.cpp.
References MapCell::centerLine, MapCell::imageIgnoreField, MapCell::lastUpdateStep, MapCell::leftLine, galaxis::utils::log_warning(), m_cellThresholdRGBValue, m_data, m_mapSize, m_updateStep, and MapCell::rightLine.
Referenced by preprocessPoints(), and updateMap().


|
private |
Definition at line 116 of file MapDataLayer.cpp.
References MapCell::centerLine, MapCell::leftLine, galaxis::utils::log_warning(), m_data, m_mapSize, and MapCell::rightLine.

| void MapDataLayer::updateMap | ( | const sensor_msgs::msg::Image::ConstSharedPtr & | laneDetectionSPtr, |
| Vector2f | currentAbsoluteCarPositionCM, | ||
| double | currentAbsoluteOrientation | ||
| ) |
Definition at line 83 of file MapDataLayer.cpp.
References m_amountOfThreads, m_mapMutex, m_sharedThreadMutex, m_threadPool, m_updateStep, and preprocessPoints().
Referenced by LaneDetectionGT::groundtruthCallback(), and AutoPilotNode::on_vci_lane_detection_callback().


| void MapDataLayer::updateMap | ( | visualization_msgs::msg::Marker::SharedPtr | laneDetectionSPtr, |
| char | laneType | ||
| ) |
Definition at line 49 of file MapDataLayer.cpp.
References m_absoluteCarPositionOffset, m_lastPointCenterLane, m_lastPointCenterLaneUsable, m_lastPointLeftLane, m_lastPointLeftLaneUsable, m_lastPointRightLane, m_lastPointRightLaneUsable, m_mapMutex, and updateCell().

|
private |
Definition at line 72 of file MapDataLayer.hpp.
Referenced by getLineObject(), init(), preprocessPoints(), and updateMap().
|
private |
Definition at line 63 of file MapDataLayer.hpp.
Referenced by getLineObject(), init(), MapDataLayer(), and updateMap().
| uint8_t MapDataLayer::m_cellLineDecreasePerView = 100 |
Definition at line 83 of file MapDataLayer.hpp.
Referenced by decreaseStepCell(), and setCellLineDecreasePerView().
| uint8_t MapDataLayer::m_cellLineIncreasePerView = 100 |
Definition at line 84 of file MapDataLayer.hpp.
Referenced by setCellLineIncreasePerView().
| uint8_t MapDataLayer::m_cellThresholdExtract = 99 |
Definition at line 82 of file MapDataLayer.hpp.
Referenced by iterateThroughMap(), and setCellThresholdExtract().
| uint8_t MapDataLayer::m_cellThresholdRGBValue = 80 |
Definition at line 81 of file MapDataLayer.hpp.
Referenced by setCellThresholdRGBValue(), and updateCell().
|
private |
Definition at line 67 of file MapDataLayer.hpp.
Referenced by clear(), iterateThroughMap(), preprocessPoints(), and updateCell().
| float MapDataLayer::m_laneImagePixelToPositionConversionFactor = 1.5625f |
Definition at line 85 of file MapDataLayer.hpp.
Referenced by preprocessPoints(), and setLaneImageConversionFactor().
|
private |
Definition at line 49 of file MapDataLayer.hpp.
Referenced by updateMap().
|
private |
Definition at line 50 of file MapDataLayer.hpp.
Referenced by updateMap().
|
private |
Definition at line 47 of file MapDataLayer.hpp.
Referenced by updateMap().
|
private |
Definition at line 48 of file MapDataLayer.hpp.
Referenced by updateMap().
|
private |
Definition at line 51 of file MapDataLayer.hpp.
Referenced by updateMap().
|
private |
Definition at line 52 of file MapDataLayer.hpp.
Referenced by updateMap().
|
private |
Definition at line 74 of file MapDataLayer.hpp.
Referenced by getLineObject(), init(), and iterateThroughMap().
| int MapDataLayer::m_lookupWindowSizeCMHeight = 150 |
Definition at line 79 of file MapDataLayer.hpp.
Referenced by AutoPilot::get_drive_information(), AutoPilot::get_lane_centers(), AutoPilot::get_lane_centers_via_polynom_thread_helper(), AutoPilotNode::send_map_debug_image(), and setLookupWindowSizeCMHeight().
| int MapDataLayer::m_lookupWindowSizeCMWidth = 160 |
Definition at line 78 of file MapDataLayer.hpp.
Referenced by AutoPilot::get_lane_centers(), AutoPilotNode::send_map_debug_image(), and setLookupWindowSizeCMWidth().
|
private |
Definition at line 69 of file MapDataLayer.hpp.
Referenced by getLineObject(), and updateMap().
|
private |
Definition at line 68 of file MapDataLayer.hpp.
Referenced by getLineObject(), init(), and updateCell().
| rclcpp::Duration MapDataLayer::m_obstacleKeepDuration |
Definition at line 90 of file MapDataLayer.hpp.
Referenced by getObstacles(), and setObstacleTrackTimeDuration().
| float MapDataLayer::m_obstaclePositionDiffForRerecognitionCM = 40.0 |
Definition at line 86 of file MapDataLayer.hpp.
Referenced by addOrUpdateStaticObstacle(), and setObstaclePositionDiffForRerecognition().
|
private |
Definition at line 64 of file MapDataLayer.hpp.
Referenced by getLineObject(), iterateThroughMap(), preprocessPoints(), and updateMap().
|
private |
Definition at line 60 of file MapDataLayer.hpp.
Referenced by enableSimulationMode(), and preprocessPoints().
| std::shared_ptr<std::vector<StaticObstacle> > MapDataLayer::m_staticObstacleVecSPtr |
Definition at line 89 of file MapDataLayer.hpp.
Referenced by addOrUpdateStaticObstacle(), getObstacles(), and init().
|
private |
Definition at line 62 of file MapDataLayer.hpp.
Referenced by getLineObject(), updateMap(), and ~MapDataLayer().
|
private |
Definition at line 70 of file MapDataLayer.hpp.
Referenced by decreaseStepCell(), iterateThroughMap(), updateCell(), and updateMap().