31#include <VirtualRobot/VirtualRobot.h>
38#include <RobotAPI/interface/core/RobotState.h>
39#include <RobotAPI/interface/units/LaserScannerUnit.h>
40#include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
66 "LaserScannerTopicName",
"LaserScans",
"Name of the laser scan topic.");
68 "RobotStateComponent",
69 "Name of the RobotStateComponent to use.");
71 "DebugDrawerTopicName",
"DebugDrawerUpdates",
"Visualize the results here.");
73 "ReportVisuTopicName",
74 "SimulatorVisuUpdates",
75 "The topic on which the visualization updates are published.");
79 "Enable to serve the purpose of a topic replayer dummy");
82 "VisuUpdateFrequency", 10,
"Visualization update frequency (Hz) for laser scans");
86 "Size of the grid cells used to generate the occupancy map in mm");
90 "Name of the frames to attach the sensor to (e.g. Node1,Node2,Node3)");
94 "Name of the devices to simulate (e.g. Device1,Device2,Device3)");
97 std::to_string(-
M_PI),
98 "Minumum angles to be reported in rad (e.g -2.35,-1.27,0)");
101 std::to_string(
M_PI),
102 "Maxiumum angles to be reported in rad (e.g 2.35,1.27,3.14)");
106 "Number of single steps (angle, distance) per scan (e.g 1081,360,270)");
110 "Noise is added to the distance of single steps (e.g 40,30,20)");
112 "visualization.enable",
114 "If enabled, useful information will be visualized in ArViz");
149 virtual public armarx::LaserScannerUnitInterface,
159 return "LaserScannerSimulation";
195 void updateScanData();
197 void fillOccupancyGrid(std::vector<VirtualRobot::SceneObjectPtr>
const& sceneObjects);
201 calculateGridDimension(
const std::vector<VirtualRobot::BoundingBox>& boundingBoxes)
const;
203 calculateGridDimension(
const std::vector<VirtualRobot::SceneObjectPtr>& sceneObjects)
const;
205 VirtualRobot::SceneObjectSetPtr
206 getCollisionObjects(
const std::vector<VirtualRobot::SceneObjectPtr>& sceneObjects)
const;
208 std::vector<VirtualRobot::BoundingBox>
209 boundingBoxes(VirtualRobot::SceneObjectSetPtr
const&
objects)
const;
211 std::string topicName;
212 LaserScannerUnitListenerPrx topic;
213 std::string robotStateName;
216 std::string debugDrawerName;
221 bool topicReplayerDummy =
false;
222 int updatePeriod = 25;
223 float gridCellSize = 20.0f;
224 int visuUpdateFrequency = 10;
226 bool enableVisualization{
false};
228 float boxPosZ = 50.0f;
230 std::vector<LaserScannerSimUnit> scanners;
236 LaserScannerInfoSeq connectedDevices;
238 std::unique_ptr<ArVizDrawer> arvizDrawer;
240 std::unique_ptr<Throttler> visuThrottler;
Provides a ready-to-use ArViz client arviz as member variable.
Default component property definition container.
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
Base Class for SensorActorUnits.
LaserScannerSimulationPropertyDefinitions(std::string prefix)
Brief description of class LaserScannerSimulation.
void onInitComponent() override
std::string getReportTopicName(const Ice::Current &) const override
void onDisconnectComponent() override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void onConnectComponent() override
LaserScannerInfoSeq getConnectedDevices(const Ice::Current &) const override
void onExitComponent() override
std::string getDefaultName() const override
virtual ~LaserScannerSimulation() override
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< ArmarXPhysicsWorldVisualization > ArmarXPhysicsWorldVisualizationPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
::IceInternal::ProxyHandle<::IceProxy::armarx::SharedRobotInterface > SharedRobotInterfacePrx
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx
::IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface > DebugDrawerInterfacePrx
SharedRobotNodeInterfacePrx frameNode