Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RobotAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Florian Leander Singer
RobotAPI
Commits
a2843171
Commit
a2843171
authored
6 years ago
by
Raphael Grimm
Browse files
Options
Downloads
Patches
Plain Diff
Remove .orig files
parent
a86f9612
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.h.orig
+0
-169
0 additions, 169 deletions
...rs/OrientedTactileSensor/OrientedTactileSensorUnit.h.orig
with
0 additions
and
169 deletions
source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.h.orig
deleted
100644 → 0
+
0
−
169
View file @
a86f9612
#ifndef SENSORPACKAGEUNIT_H
#define SENSORPACKAGEUNIT_H
#include <ArmarXCore/core/Component.h>
#include <RobotAPI/interface/units/UnitInterface.h>
#include <RobotAPI/interface/units/OrientedTactileSensorUnit.h>
#include <ArmarXCore/core/services/tasks/PeriodicTask.h>
#include <ArmarXCore/core/services/tasks/RunningTask.h>
#include <netinet/in.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <Eigen/Dense>
#include <RobotAPI/libraries/SimpleJsonLogger/SimpleJsonLogger.h>
namespace armarx
{
class OrientedTactileSensorUnitPropertyDefinitions:
public ComponentPropertyDefinitions
{
public:
OrientedTactileSensorUnitPropertyDefinitions(std::string prefix):
ComponentPropertyDefinitions(prefix)
{
defineOptionalProperty<std::string>(
"SerialInterfaceDevice",
"/dev/ttyACM0",
"The serial device the arduino is connected to.");
defineOptionalProperty<std::string>(
"TopicName",
"OrientedTactileSensorValues",
"Name of the topic on which the sensor values are provided");
defineOptionalProperty<std::string>(
"CalibrationData",
"65524 3 12 65534 65534 1 1208 119 58726 1000 943 ",
"Sensor Register Data to calibrate the sensor");
defineOptionalProperty<std::size_t>(
"SamplesRotation",
20,
"number of orientation values to differentiate");
defineOptionalProperty<std::size_t>(
"SamplesPressure",
10,
"number of pressure values to differentiate");
defineOptionalProperty<std::size_t>(
"SamplesAcceleration",
20,
"number of pressure values to differentiate");
defineOptionalProperty<bool>(
"logData",
"false",
"log data from sensor");
defineOptionalProperty<bool>(
"calibrateSensor",
"false"
"Set true to calibrate the sensor and get calibration data and false to use existent calibration data");
}
};
/**
* @class OrientedTactileSensorUnit
* @brief ArmarX wrapper for an arduino due with one BNO055 IMU and one BMP280 pressure sensor
*
*/
class OrientedTactileSensorUnit:
virtual public armarx::Component
//TODO: needs interface to send calibration data
{
public:
OrientedTactileSensorUnit();
virtual std::string getDefaultName() const
{
return "OrientedTactileSensorUnit";
}
struct SensorData
{
int id;
float pressure;
float qw, qx, qy, qz;
float accelx, accely, accelz;
};
struct CalibrationData
{
int accel_offset_x, accel_offset_y, accel_offset_z, gyro_offset_x, gyro_offset_y, gyro_offset_z, mag_offset_x, mag_offset_y, mag_offset_z, accel_radius, mag_radius;
};
struct PressureRate
{
IceUtil::Time timestamp;
float pressure;
};
struct RotationRate
{
IceUtil::Time timestamp;
Eigen::Quaternionf orientation;
};
struct AccelerationRate
{
IceUtil::Time timestamp;
float rotationRate;
};
struct LinAccRate
{
IceUtil::Time timestamp;
float accx, accy, accz;
};
protected:
virtual void onInitComponent();
virtual void onConnectComponent();
virtual PropertyDefinitionsPtr createPropertyDefinitions();
private:
std::ifstream arduinoIn;
std::ofstream arduinoOut;
RunningTask<OrientedTactileSensorUnit>::pointer_type readTask;
OrientedTactileSensorUnitListenerPrx topicPrx;
OrientedTactileSensorUnitInterfacePrx interfacePrx;
void run();
SensorData getValues(std::string line);
bool getCalibrationValues(std::string line);
bool loadCalibration();
int fd;
CalibrationData calibration;
Eigen::Quaternionf inverseOrientation;
std::vector<RotationRate> samplesRotation;
std::vector<PressureRate> samplesPressure;
std::vector<AccelerationRate> samplesAcceleration;
<<<<<<< HEAD
std::vector<float> pressureRates;
int maxSamplesRotation;
int sampleIndexRotation;
int maxSamplesPressure;
int sampleIndexPressure;
int maxSamplesAcceleration;
int sampleIndexAcceleration;
int sampleIndexPressureRate;
float sumPressureRates;
bool first;
int i = 0;
SimpleJsonLoggerPtr logger;
std::string prefix;
=======
std::size_t maxSamplesRotation;
std::size_t sampleIndexRotation;
std::size_t maxSamplesPressure;
std::size_t sampleIndexPressure;
std::size_t maxSamplesAcceleration;
std::size_t sampleIndexAcceleration;
>>>>>>> master
};
}
#endif // SENSORPACKAGEUNIT_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment