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,
196 void updateScanData();
198 void fillOccupancyGrid(std::vector<VirtualRobot::SceneObjectPtr>
const& sceneObjects);
202 calculateGridDimension(
const std::vector<VirtualRobot::BoundingBox>& boundingBoxes)
const;
204 calculateGridDimension(
const std::vector<VirtualRobot::SceneObjectPtr>& sceneObjects)
const;
206 VirtualRobot::SceneObjectSetPtr
207 getCollisionObjects(
const std::vector<VirtualRobot::SceneObjectPtr>& sceneObjects)
const;
209 std::vector<VirtualRobot::BoundingBox>
210 boundingBoxes(VirtualRobot::SceneObjectSetPtr
const&
objects)
const;
212 std::string topicName;
213 LaserScannerUnitListenerPrx topic;
214 std::string robotStateName;
217 std::string debugDrawerName;
222 bool topicReplayerDummy =
false;
223 int updatePeriod = 25;
224 float gridCellSize = 20.0f;
225 int visuUpdateFrequency = 10;
227 bool enableVisualization{
false};
229 float boxPosZ = 50.0f;
231 std::vector<LaserScannerSimUnit> scanners;
237 LaserScannerInfoSeq connectedDevices;
239 std::unique_ptr<ArVizDrawer> arvizDrawer;
241 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
static std::string GetDefaultName()
LaserScannerInfoSeq getConnectedDevices(const Ice::Current &) const override
void onExitComponent() override
std::string getDefaultName() const override
Retrieve default name of component.
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