Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
common_lib::communication Namespace Reference

Classes

struct  HasPosition
 A helper struct to check if a type T has a member named 'position'. More...
 
struct  HasPosition< T, std::enable_if_t< std::is_arithmetic_v< decltype(std::declval< T >().position.x)> &&std::is_arithmetic_v< decltype(std::declval< T >().position.y)> > >
 A specialization of the has_position struct for types T that do have a valid 'position' member. More...
 

Functions

std::vector< common_lib::structures::PathPointpath_point_array_from_ci_vector (const custom_interfaces::msg::PathPointArray &path_point_array)
 Convert from custom interfaces PathPointArray to vector of common_lib PathPoints.
 
custom_interfaces::msg::ConeArray custom_interfaces_array_from_vector (const std::vector< common_lib::structures::Cone > &input_cones)
 
custom_interfaces::msg::PathPointArray custom_interfaces_array_from_vector (const std::vector< common_lib::structures::PathPoint > &input_path, bool is_map_closed)
 
std::vector< common_lib::structures::Conecone_vector_from_custom_interfaces (const custom_interfaces::msg::ConeArray &msg)
 
const std::map< std::string, std::array< float, 4 >, std::less<> > & marker_color_map ()
 
const std::map< std::string, int, std::less<> > & marker_shape_map ()
 
template<typename T >
visualization_msgs::msg::MarkerArray marker_array_from_structure_array (const std::vector< T > &structure_array, const std::string &name_space, const std::string &frame_id, const std::string &color="red", const std::string &shape="cylinder", float scale=0.5, int action=visualization_msgs::msg::Marker::MODIFY)
 Converts a vector of cones to a marker array.
 
template<typename T >
visualization_msgs::msg::Marker line_marker_from_structure_array (const std::vector< T > &structure_array, const std::string &name_space, const std::string &frame_id, const int id, const std::string &color="red", const std::string &shape="line", float scale=0.1f, int action=visualization_msgs::msg::Marker::MODIFY)
 Converts a vector of cones to a marker array.
 
visualization_msgs::msg::Marker marker_from_position (const common_lib::structures::Position &position, const std::string &name_space, const int id, const std::string &color="red", float scale=0.5, const std::string &frame_id="map", const std::string &shape="sphere", int action=visualization_msgs::msg::Marker::ADD)
 Converts a position to a marker.
 
visualization_msgs::msg::Marker lines_marker_from_triangulations (const std::vector< std::pair< Point, Point > > &triangulations, const std::string &name_space, const std::string &frame_id, int id, const std::string &color, float scale, int action)
 Converts a vector of triangulation edges to a marker.
 
visualization_msgs::msg::MarkerArray velocity_hover_markers (const std::vector< common_lib::structures::PathPoint > &path_array, const std::string &name_space, const std::string &frame_id, float scale=0.2f, int every_nth=1)
 Creates sphere markers at each path point with velocity in the marker namespace When you hover over these in Foxglove's 3D panel, it shows the velocity in the tooltip.
 

Function Documentation

◆ cone_vector_from_custom_interfaces()

std::vector< common_lib::structures::Cone > common_lib::communication::cone_vector_from_custom_interfaces ( const custom_interfaces::msg::ConeArray &  msg)

Definition at line 44 of file interfaces.cpp.

Here is the caller graph for this function:

◆ custom_interfaces_array_from_vector() [1/2]

custom_interfaces::msg::ConeArray common_lib::communication::custom_interfaces_array_from_vector ( const std::vector< common_lib::structures::Cone > &  input_cones)

Definition at line 18 of file interfaces.cpp.

Here is the caller graph for this function:

◆ custom_interfaces_array_from_vector() [2/2]

custom_interfaces::msg::PathPointArray common_lib::communication::custom_interfaces_array_from_vector ( const std::vector< common_lib::structures::PathPoint > &  input_path,
bool  is_map_closed 
)

Definition at line 29 of file interfaces.cpp.

◆ line_marker_from_structure_array()

template<typename T >
visualization_msgs::msg::Marker common_lib::communication::line_marker_from_structure_array ( const std::vector< T > &  structure_array,
const std::string &  name_space,
const std::string &  frame_id,
const int  id,
const std::string &  color = "red",
const std::string &  shape = "line",
float  scale = 0.1f,
int  action = visualization_msgs::msg::Marker::MODIFY 
)

Converts a vector of cones to a marker array.

Parameters
cone_arrayvector of cones
colorcolor of the marker (blue, yellow, orange, red, green)
shapeshape of the marker (cylinder, cube, sphere)
frame_idframe id of the marker, for transforms
name_spacenamespace of the marker, used in conjunction with ID to identify marker
scalescale of the marker, default is 0.5
actionaction of the marker, default is ADD/MODIFY
Returns
visualization_msgs::msg::MarkerArray

Definition at line 158 of file marker.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lines_marker_from_triangulations()

visualization_msgs::msg::Marker common_lib::communication::lines_marker_from_triangulations ( const std::vector< std::pair< Point, Point > > &  triangulations,
const std::string &  name_space,
const std::string &  frame_id,
int  id,
const std::string &  color,
float  scale,
int  action 
)

Converts a vector of triangulation edges to a marker.

Parameters
triangulationsVector of edges, where each edge is a pair of Points
name_spaceNamespace of the marker, used in conjunction with ID to identify the marker
frame_idFrame id of the marker
idId of the marker
colorColor of the marker
scaleThickness of the lines
actionaction of the marker
Returns
visualization_msgs::msg::Marker

Definition at line 41 of file marker.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ marker_array_from_structure_array()

template<typename T >
visualization_msgs::msg::MarkerArray common_lib::communication::marker_array_from_structure_array ( const std::vector< T > &  structure_array,
const std::string &  name_space,
const std::string &  frame_id,
const std::string &  color = "red",
const std::string &  shape = "cylinder",
float  scale = 0.5,
int  action = visualization_msgs::msg::Marker::MODIFY 
)

Converts a vector of cones to a marker array.

Parameters
cone_arrayvector of cones
colorcolor of the marker (blue, yellow, orange, red, green)
shapeshape of the marker (cylinder, cube, sphere)
frame_idframe id of the marker, for transforms
name_spacenamespace of the marker, used in conjunction with ID to identify marker
scalescale of the marker, default is 0.5
actionaction of the marker, default is ADD/MODIFY
Returns
visualization_msgs::msg::MarkerArray

Definition at line 79 of file marker.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ marker_color_map()

const std::map< std::string, std::array< float, 4 >, std::less<> > & common_lib::communication::marker_color_map ( )
inline

Definition at line 21 of file marker.hpp.

Here is the caller graph for this function:

◆ marker_from_position()

visualization_msgs::msg::Marker common_lib::communication::marker_from_position ( const common_lib::structures::Position position,
const std::string &  name_space,
const int  id,
const std::string &  color = "red",
float  scale = 0.5,
const std::string &  frame_id = "map",
const std::string &  shape = "sphere",
int  action = visualization_msgs::msg::Marker::ADD 
)

Converts a position to a marker.

Parameters
positionposition to convert
name_spacenamespace of the marker, used in conjunction with ID to identify marker
idid of the marker
colorcolor of the marker (blue, yellow, orange, red, green)
scalescale of the marker, default is 0.5
frame_idframe id of the marker, for transforms
shapeshape of the marker (cylinder, cube, sphere)
actionaction of the marker, default is ADD/MODIFY
Returns
visualization_msgs::msg::Marker

Definition at line 5 of file marker.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ marker_shape_map()

const std::map< std::string, int, std::less<> > & common_lib::communication::marker_shape_map ( )
inline

Definition at line 31 of file marker.hpp.

Here is the caller graph for this function:

◆ path_point_array_from_ci_vector()

std::vector< common_lib::structures::PathPoint > common_lib::communication::path_point_array_from_ci_vector ( const custom_interfaces::msg::PathPointArray &  path_point_array)

Convert from custom interfaces PathPointArray to vector of common_lib PathPoints.

Parameters
path_point_array
Returns
std::vector<common_lib::structures::PathPoint>

Definition at line 5 of file interfaces.cpp.

Here is the caller graph for this function:

◆ velocity_hover_markers()

visualization_msgs::msg::MarkerArray common_lib::communication::velocity_hover_markers ( const std::vector< common_lib::structures::PathPoint > &  path_array,
const std::string &  name_space,
const std::string &  frame_id,
float  scale = 0.2f,
int  every_nth = 1 
)

Creates sphere markers at each path point with velocity in the marker namespace When you hover over these in Foxglove's 3D panel, it shows the velocity in the tooltip.

Parameters
path_arrayvector of PathPoints
name_spacebase namespace of the markers
frame_idframe id
scalesize of the spheres
every_nthshow sphere every nth point
Returns
visualization_msgs::msg::MarkerArray

Definition at line 79 of file marker.cpp.

Here is the caller graph for this function: