mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 01:50:46 +02:00
Verified that the use of a char buffer + string concatenation is actually faster than a stringstram
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
#include "ur_realtime_communication.h"
|
#include "ur_realtime_communication.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class UrDriver {
|
class UrDriver {
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ void UrDriver::addTraj(std::vector<double> inp_timestamps,
|
|||||||
|
|
||||||
timestamps.push_back(inp_timestamps[inp_timestamps.size() - 1]);
|
timestamps.push_back(inp_timestamps[inp_timestamps.size() - 1]);
|
||||||
positions.push_back(inp_positions[inp_positions.size() - 1]);
|
positions.push_back(inp_positions[inp_positions.size() - 1]);
|
||||||
|
/* This is actually faster than using a stringstream :-o */
|
||||||
for (unsigned int i = 1; i < timestamps.size(); i++) {
|
for (unsigned int i = 1; i < timestamps.size(); i++) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
sprintf(buf,
|
sprintf(buf,
|
||||||
|
|||||||
Reference in New Issue
Block a user