-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,164 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
63.437946025438066 10.507175268806458 | ||
63.43787563495969 10.507121157686353 | ||
63.4378360402396 10.50719002638467 | ||
63.43763366637102 10.50697358190425 | ||
63.43760726967404 10.507101480915406 | ||
63.43713432473124 10.506752218231092 | ||
63.437239913116464 10.505876601923934 | ||
63.438056010214204 10.506461985859616 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
landmark_server_node: | ||
ros__parameters: | ||
fixed_frame: map | ||
target_frame: base_link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
map_manager_node: | ||
ros__parameters: | ||
use_predef_landmask: true | ||
landmask_file: "src/vortex-asv/asv_setup/config/sitaw/land_polygon.yaml" | ||
map_resolution: 0.2 | ||
map_width: 1000 | ||
map_height: 1000 | ||
frame_id: "map" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
seapath_ros_driver_node: | ||
ros__parameters: | ||
UDP_IP: "10.0.1.10" # Source IP of the host sender | ||
UDP_PORT: 31421 # Port at which to receive UDP semgents | ||
use_predef_map_origin: false | ||
map_origin_lat: 0.0 | ||
map_origin_lon: 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import os | ||
from ament_index_python.packages import get_package_share_directory | ||
from launch import LaunchDescription | ||
from launch.actions import IncludeLaunchDescription, DeclareLaunchArgument | ||
from launch_ros.actions import Node | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.conditions import IfCondition | ||
from launch.substitutions import LaunchConfiguration | ||
|
||
|
||
def generate_launch_description(): | ||
enable_tf = LaunchConfiguration('enable_tf') | ||
enable_tf_arg = DeclareLaunchArgument( | ||
'enable_tf', | ||
default_value='True', | ||
description='enable tf launch file', | ||
) | ||
|
||
seapath_ros_driver_node = Node( | ||
package='seapath_ros_driver', | ||
executable='seapath_ros_driver_node', | ||
name='seapath_ros_driver_node', | ||
parameters=[os.path.join(get_package_share_directory('asv_setup'),'config','sitaw','seapath_params.yaml')], | ||
output='screen', | ||
) | ||
map_manager_node = Node( | ||
package='map_manager', | ||
executable='map_manager_node', | ||
name='map_manager_node', | ||
parameters=[os.path.join(get_package_share_directory('asv_setup'),'config','sitaw','map_manager_params.yaml')], | ||
output='screen', | ||
) | ||
landmark_server_node = Node( | ||
package='landmark_server', | ||
executable='landmark_server_node', | ||
name='landmark_server_node', | ||
parameters=[os.path.join(get_package_share_directory('asv_setup'),'config','sitaw','landmark_server_params.yaml')], | ||
# arguments=['--ros-args', '--log-level', 'DEBUG'], | ||
output='screen', | ||
) | ||
tf_launch = IncludeLaunchDescription( | ||
launch_description_source=PythonLaunchDescriptionSource(os.path.join(get_package_share_directory('asv_setup'), 'launch', 'tf.launch.py')), | ||
condition=IfCondition(enable_tf), | ||
) | ||
return LaunchDescription([ | ||
enable_tf_arg, | ||
tf_launch, | ||
seapath_ros_driver_node, | ||
map_manager_node, | ||
landmark_server_node | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ def generate_launch_description(): | |
return LaunchDescription([ | ||
dp_guidance_node | ||
]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
mission/landmark_server/include/landmark_server/grid_manager.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
#include <vector> | ||
#include <cstdint> | ||
#include <tuple> | ||
#include <Eigen/Dense> | ||
|
||
namespace landmark_server | ||
{ | ||
|
||
enum class ShapeType : uint8_t | ||
{ | ||
SPHERE = 0, | ||
PRISM = 1 | ||
}; | ||
|
||
struct Circle | ||
{ | ||
float radius; | ||
float x_centre; | ||
float y_centre; | ||
}; | ||
|
||
struct Point | ||
{ | ||
float x; | ||
float y; | ||
float z; | ||
}; | ||
|
||
struct Polygon | ||
{ | ||
std::vector<Point> vertices; | ||
}; | ||
|
||
struct Pose | ||
{ | ||
float x; | ||
float y; | ||
float yaw; | ||
}; | ||
|
||
|
||
struct ShapeInfo | ||
{ | ||
ShapeType type; | ||
Circle circle; | ||
Polygon polygon; | ||
Pose pose; | ||
|
||
}; | ||
|
||
|
||
|
||
|
||
class GridManager | ||
{ | ||
|
||
public: | ||
using Grid = Eigen::Array<int8_t, Eigen::Dynamic, Eigen::Dynamic>; | ||
|
||
// GridManager(std::vector<int8_t> grid, float resolution, uint32_t height, uint32_t width); | ||
GridManager(float resolution, uint32_t height, uint32_t width); | ||
~GridManager() = default; | ||
|
||
const Grid& get_grid() const; | ||
|
||
|
||
|
||
void update_grid(int8_t* grid, const Eigen::Array<float, 2, Eigen::Dynamic>& polygon, int value); | ||
|
||
std::tuple<int, int> world_to_grid(float x, float y); | ||
|
||
|
||
void handle_circle(int xc, int yc, int r, int value); | ||
|
||
void draw_circle(int xc, int yc, int x, int y, int value, Eigen::Block<landmark_server::GridManager::Grid, -1, -1, false>& block, int xmin, int ymin); | ||
|
||
|
||
void handle_polygon(int8_t* grid, const Eigen::Array<float, 2, Eigen::Dynamic>& vertices, int value); | ||
|
||
void draw_polygon(int x0, int y0, int x1, int y1, Eigen::Block<landmark_server::GridManager::Grid, -1, -1, false>& block, int value); | ||
void draw_line(int x0, int y0, int x1, int y1, int8_t* grid, int value); | ||
|
||
|
||
|
||
|
||
private: | ||
Grid grid_; | ||
float resolution_; | ||
uint32_t height_; | ||
uint32_t width_; | ||
|
||
|
||
}; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import os | ||
from ament_index_python.packages import get_package_share_directory | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from launch.actions import (DeclareLaunchArgument) | ||
from launch.substitutions import LaunchConfiguration | ||
|
||
def generate_launch_description(): | ||
default_params_file = os.path.join(get_package_share_directory('landmark_server'),'params','landmark_server_params.yaml') | ||
params_file = LaunchConfiguration('params_file') | ||
params_file_arg = DeclareLaunchArgument('params_file', | ||
default_value=str( | ||
default_params_file), | ||
description='name or path to the parameters file to use.') | ||
landmark_server_node = Node( | ||
package='landmark_server', | ||
executable='landmark_server_node', | ||
name='landmark_server_node', | ||
parameters=[params_file], | ||
# arguments=['--ros-args', '--log-level', 'DEBUG'], | ||
output='screen', | ||
) | ||
return LaunchDescription([ | ||
params_file_arg, | ||
landmark_server_node | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
landmark_server_node: | ||
ros__parameters: | ||
fixed_frame: world | ||
target_frame: base_link |
Oops, something went wrong.