![]() |
An open-source, flexible 3D physical simulation framework
|
#include <RotatingRaySensor.h>
Public Member Functions | |
RotatingRaySensor (interfaces::ControlCenter *control, RotatingRayConfig config) | |
~RotatingRaySensor (void) | |
bool | getPointcloud (std::vector< utils::Vector > &pointcloud) |
Returns a complete scan covering the complete defined horizontal range. More... | |
int | getSensorData (double **) const |
Copies the current full pointcloud to a double array with (x,y,z). More... | |
virtual void | receiveData (const data_broker::DataInfo &info, const data_broker::DataPackage &package, int callbackParam) |
Receives the measured distances, calculates the vectors in the local sensor frame and transfers them into the world to compensate the movement during pointcloud gathering. More... | |
virtual void | update (std::vector< interfaces::draw_item > *drawItems) |
Uses the current node pose and the current distances to draw the laser rays. More... | |
virtual configmaps::ConfigMap | createConfig () const |
const RotatingRayConfig & | getConfig () const |
utils::Quaternion | turn () |
Turns the sensor during each simulation step. More... | |
int | getNumberRays () |
Number of lasers * number of bands. More... | |
std::vector< utils::Vector > & | getDirections () |
Returns all the ray directions as normalized vectors. More... | |
![]() | |
BasePolarIntersectionSensor (unsigned long id, std::string name, int cols, int rows, double angleX, double angleY, double maxDistance=std::numeric_limits< double >::infinity()) | |
virtual | ~BasePolarIntersectionSensor () |
![]() | |
BaseNodeSensor (unsigned long id, std::string name) | |
virtual | ~BaseNodeSensor () |
utils::Quaternion | getOrientation () const |
unsigned long | getAttachedNode () |
![]() | |
BaseSensor () | |
virtual | ~BaseSensor () |
BaseSensor (unsigned long id, std::string name) | |
unsigned long | getID () const |
const std::string | getName () const |
virtual int | getAsciiData (char *data) const |
void | getCoreExchange (core_objects_exchange *obj) const |
![]() | |
BaseArraySensor (int cols, int rows, int channels=1) | |
virtual | ~BaseArraySensor () |
const std::vector< double > | getData () const |
const int & | getCols () const |
const int & | getRows () const |
const int & | getChannels () const |
double & | operator[] (const int &index) |
virtual void | resize (int cols, int rows, int channels=1) |
![]() | |
SensorInterface (ControlCenter *center) | |
virtual | ~SensorInterface () |
![]() | |
ReceiverInterface () | |
virtual | ~ReceiverInterface () |
![]() | |
virtual | ~DrawInterface () |
Static Public Member Functions | |
static interfaces::BaseSensor * | instanciate (interfaces::ControlCenter *control, interfaces::BaseConfig *config) |
static interfaces::BaseConfig * | parseConfig (interfaces::ControlCenter *control, configmaps::ConfigMap *config) |
Config methods all part of BaseSensor. More... | |
![]() | |
static BaseConfig * | parseConfig (ControlCenter *control, configmaps::ConfigMap *config) |
Public Attributes | |
RotatingRayConfig | config |
![]() | |
double | stepX |
double | stepY |
double | maxDistance |
![]() | |
unsigned long | id |
std::string | name |
unsigned long | updateRate |
Protected Member Functions | |
void | run () |
The thread will execute this method once it has been started . More... | |
Private Attributes | |
std::vector< utils::Vector > | directions |
Contains the normalized scan directions. More... | |
std::list< utils::Vector > | pointcloud1 |
std::list< utils::Vector > | pointcloud2 |
std::list< utils::Vector > * | toCloud |
std::list< utils::Vector > * | fromCloud |
std::vector< utils::Vector > | pointcloud_full |
bool | convertPointCloud |
int | nextCloud |
double | vertical_resolution |
bool | update_available |
bool | full_scan |
double | turning_offset |
double | turning_end_fullscan |
utils::Quaternion | orientation_offset |
long | positionIndices [3] |
long | rotationIndices [4] |
double | turning_step |
int | nsamples |
mars::utils::Mutex | mutex_pointcloud |
mars::utils::Mutex | poseMutex |
Eigen::Affine3d | current_pose |
bool | closeThread |
unsigned int | num_points |
Additional Inherited Members | |
![]() | |
unsigned long | attached_node |
bool | calcAcceletaion |
bool | calcSpeed |
bool | calcPosition |
bool | calcRotationSpeed |
bool | calcOrientation |
utils::Vector | acceleration |
utils::Vector | speed |
utils::Vector | position |
utils::Vector | rotationSpeed |
utils::Quaternion | orientation |
![]() | |
int | cols |
int | rows |
int | channels |
std::vector< double > | data |
![]() | |
ControlCenter * | control |
![]() | |
Thread () | |
virtual | ~Thread () |
void | start () |
Starts the execution of this Thread. More... | |
void | cancel (bool block=false) |
Tries to cancel the Thread. More... | |
void | setCancellationPoint () |
Adds a cancellation point to your run method. More... | |
bool | wait () |
stops execution until the thread has finished. More... | |
bool | join () |
bool | wait (unsigned long timeoutMilliseconds) |
puts the Thread to sleep for a specified amount of time. More... | |
bool | isRunning () const |
returns true if the Thread is running. More... | |
bool | isFinished () const |
void | setStackSize (std::size_t stackSize) |
std::size_t | getStackSize () const |
bool | isCurrentThread () const |
![]() | |
static Thread * | getCurrentThread () |
static void | cancelAll (bool block=false) |
static void | msleep (unsigned long msec) |
causes the current thread to sleep for More... | |
Definition at line 89 of file RotatingRaySensor.h.
mars::sim::RotatingRaySensor::RotatingRaySensor | ( | interfaces::ControlCenter * | control, |
RotatingRayConfig | config | ||
) |
Definition at line 56 of file RotatingRaySensor.cpp.
mars::sim::RotatingRaySensor::~RotatingRaySensor | ( | void | ) |
Definition at line 170 of file RotatingRaySensor.cpp.
|
virtual |
Reimplemented from mars::interfaces::BaseSensor.
Definition at line 408 of file RotatingRaySensor.cpp.
const RotatingRayConfig & mars::sim::RotatingRaySensor::getConfig | ( | ) | const |
Definition at line 435 of file RotatingRaySensor.cpp.
|
inline |
Returns all the ray directions as normalized vectors.
Definition at line 164 of file RotatingRaySensor.h.
int mars::sim::RotatingRaySensor::getNumberRays | ( | ) |
Number of lasers * number of bands.
Definition at line 313 of file RotatingRaySensor.cpp.
bool mars::sim::RotatingRaySensor::getPointcloud | ( | std::vector< utils::Vector > & | pointcloud | ) |
Returns a complete scan covering the complete defined horizontal range.
The pointcloud is gathered within the world frame and
Definition at line 177 of file RotatingRaySensor.cpp.
|
virtual |
Copies the current full pointcloud to a double array with (x,y,z).
Reimplemented from mars::interfaces::BasePolarIntersectionSensor.
Definition at line 188 of file RotatingRaySensor.cpp.
|
static |
Definition at line 50 of file RotatingRaySensor.cpp.
|
static |
Config methods all part of BaseSensor.
Definition at line 350 of file RotatingRaySensor.cpp.
|
virtual |
Receives the measured distances, calculates the vectors in the local sensor frame and transfers them into the world to compensate the movement during pointcloud gathering.
The points are transformed back to the current node pose when the pointcloud is requested. Inherited from ReceiverInterface. Method is called by the DataBroker as soon as the registered event occurs.
Implements mars::data_broker::ReceiverInterface.
Definition at line 200 of file RotatingRaySensor.cpp.
|
protectedvirtual |
The thread will execute this method once it has been started .
Implements mars::utils::Thread.
Definition at line 317 of file RotatingRaySensor.cpp.
utils::Quaternion mars::sim::RotatingRaySensor::turn | ( | ) |
Turns the sensor during each simulation step.
As soon as a full scan has been done (depends on the number of bands) the pointcloud is copied to pointcloud_full and a new scan is initiated. Runs in the same thread than receiveData, so only the use of full_pointcloud (turn(), getPointcloud() and getSensorData()) has to be synchronized.
Definition at line 288 of file RotatingRaySensor.cpp.
|
virtual |
Uses the current node pose and the current distances to draw the laser rays.
Inherited from DrawInterface.
Implements mars::interfaces::DrawInterface.
Definition at line 266 of file RotatingRaySensor.cpp.
|
private |
Definition at line 197 of file RotatingRaySensor.h.
RotatingRayConfig mars::sim::RotatingRaySensor::config |
Definition at line 168 of file RotatingRaySensor.h.
|
private |
Definition at line 183 of file RotatingRaySensor.h.
|
private |
Definition at line 196 of file RotatingRaySensor.h.
|
private |
Contains the normalized scan directions.
Definition at line 175 of file RotatingRaySensor.h.
|
private |
Definition at line 181 of file RotatingRaySensor.h.
|
private |
Definition at line 187 of file RotatingRaySensor.h.
|
mutableprivate |
Definition at line 195 of file RotatingRaySensor.h.
|
private |
Definition at line 184 of file RotatingRaySensor.h.
|
private |
Definition at line 194 of file RotatingRaySensor.h.
|
private |
Definition at line 198 of file RotatingRaySensor.h.
|
private |
Definition at line 190 of file RotatingRaySensor.h.
|
private |
Definition at line 179 of file RotatingRaySensor.h.
|
private |
Definition at line 180 of file RotatingRaySensor.h.
|
private |
Definition at line 182 of file RotatingRaySensor.h.
|
mutableprivate |
Definition at line 195 of file RotatingRaySensor.h.
|
private |
Definition at line 191 of file RotatingRaySensor.h.
|
private |
Definition at line 192 of file RotatingRaySensor.h.
|
private |
Definition at line 181 of file RotatingRaySensor.h.
|
private |
Definition at line 189 of file RotatingRaySensor.h.
|
private |
Definition at line 188 of file RotatingRaySensor.h.
|
private |
Definition at line 193 of file RotatingRaySensor.h.
|
private |
Definition at line 186 of file RotatingRaySensor.h.
|
private |
Definition at line 185 of file RotatingRaySensor.h.