68 int main(
int argc,
char** argv)
70 ros::init(argc, argv,
"psen_scan_v2_node");
78 getOptionalParamFromServer<double>(
81 getOptionalParamFromServer<double>(
103 if (scanner_configuration.fragmentedScansEnabled())
105 ROS_INFO(
"Using fragmented scans.");
112 scanner_configuration);
116 ros_scanner_node.
run();
118 catch (std::exception&
e)
121 std::cerr <<
"\x1B[91m" << e.what() <<
"\033[0m\n";
static constexpr unsigned short DATA_PORT_OF_HOST_DEVICE
ScannerConfigurationBuilder & hostIP(const std::string &host_ip)
REGISTER_ROSCONSOLE_BRIDGE
ROS Node that continuously publishes scan data of a single PSENscan laser scanner.
const std::string PARAM_ANGLE_END
const std::string PARAM_ANGLE_START
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
static TenthOfDegree fromRad(const double &angle_in_rad)
static constexpr double DEFAULT_SCAN_ANGLE_RESOLUTION(data_conversion_layer::degreeToRadian(0.1))
std::function< void()> NODE_TERMINATE_CALLBACK
Contains the events needed to define and implement the scanner protocol.
ScannerConfigurationBuilder & enableDiagnostics(const bool &enable)
static constexpr double DEFAULT_ANGLE_START(-data_conversion_layer::degreeToRadian(137.4))
Start angle of measurement.
static const std::string DEFAULT_TF_PREFIX
ScannerConfigurationBuilder & hostDataPort(const int &host_data_port)
static constexpr bool INTENSITIES
static constexpr unsigned short CONTROL_PORT_OF_HOST_DEVICE
Higher level data type storing the configuration details of the scanner like scanner IP...
static constexpr double DEFAULT_X_AXIS_ROTATION
The 2D scan will be rotated around the z-axis.
const std::string PARAM_HOST_IP
static constexpr unsigned short CONTROL_PORT_OF_SCANNER_DEVICE
void terminate()
Terminates the fetching and publishing of scanner data.
ScannerConfigurationBuilder & scannerControlPort(const int &scanner_control_port)
void run()
Continuously fetches data from the scanner and publishes the data into the ROS network.
Root namespace in which the software components to communicate with the scanner (firmware-version: 2)...
Higher level data type storing the range in which the scanner takes measurements. ...
const std::string PARAM_TF_PREFIX
Root namespace for the ROS part.
ScannerConfigurationBuilder & hostControlPort(const int &host_control_port)
ScannerConfigurationBuilder & scannerDataPort(const int &scanner_data_port)
void delayed_shutdown_sig_handler(int sig)
static const std::string DEFAULT_HOST_IP_STRING
ScannerConfigurationBuilder & enableIntensities(const bool &enable)
static constexpr double DEFAULT_ANGLE_END(data_conversion_layer::degreeToRadian(137.4))
End angle of measurement.
Helper class to simplify/improve the construction of the psen_scan_v2_standalone::ScannerConfiguratio...
static const std::string DEFAULT_PUBLISH_TOPIC
Topic on which the LaserScan data are published.
const std::string PARAM_X_AXIS_ROTATION
const std::string PARAM_RESOLUTION
const std::string PARAM_HOST_DATA_PORT
ScannerConfigurationBuilder & scanRange(const ScanRange &scan_range)
ROSCPP_DECL void shutdown()
int main(int argc, char **argv)
const std::string PARAM_FRAGMENTED_SCANS
#define ROS_ERROR_STREAM(args)
ScannerConfigurationBuilder & scanResolution(const util::TenthOfDegree &scan_resolution)
static constexpr bool FRAGMENTED_SCANS
static constexpr unsigned short DATA_PORT_OF_SCANNER_DEVICE
const std::string PARAM_SCANNER_IP
const std::string PARAM_HOST_CONTROL_PORT
const std::string PARAM_INTENSITIES
ScannerConfigurationBuilder & enableFragmentedScans(const bool &enable)
ScannerConfiguration build() const