Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions include/sas_datalogger/sas_datalogger_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

#include <eigen3/Eigen/Dense>

using namespace Eigen;

namespace sas
{
Expand Down Expand Up @@ -68,12 +67,12 @@ class DataloggerClient: private sas::Object
bool is_enabled(int server_count=1) const;

/**
* @brief Log a matrix (MatrixXd) or vector (VectorXd) value under the given name.
* @brief Log a matrix (Eigen::MatrixXd) or vector (Eigen::VectorXd) value under the given name.
*
* @param name Key/name under which the value will be logged.
* @param value the Eigen::Ref<const MatrixXd> value to log.
* @param value the Eigen::Ref<const Eigen::MatrixXd> value to log.
*/
void log(const std::string& name, const Eigen::Ref<const MatrixXd>& value);
void log(const std::string& name, const Eigen::Ref<const Eigen::MatrixXd>& value);

/**
* @brief Log a std::vector<double> value under the given name.
Expand Down
4 changes: 2 additions & 2 deletions src/examples/sas_datalogger_client_example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ int main(int argc,char** argv)

for (auto i = 0; i < 5; i++)
{
MatrixXd A(3,4); A << 1,2,3,4,5,6,7,8,9,10,11,12;
Eigen::MatrixXd A(3,4); A << 1,2,3,4,5,6,7,8,9,10,11,12;
datalogger_client.log("A",A);
datalogger_client.log("two_A",A+A);

VectorXd v(5); v << 1,5,10,15,20;
Eigen::VectorXd v(5); v << 1,5,10,15,20;
datalogger_client.log("v",v);
datalogger_client.log("two_v",v+v);

Expand Down
2 changes: 1 addition & 1 deletion src/sas_datalogger_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool DataloggerClient::is_enabled(int server_count) const
return (int(publisher_log_->get_subscription_count()) >= server_count);
}

void DataloggerClient::log(const std::string& name, const Eigen::Ref<const MatrixXd>& value)
void DataloggerClient::log(const std::string& name, const Eigen::Ref<const Eigen::MatrixXd>& value)
{
sas_msgs::msg::LogDatum msg;

Expand Down
2 changes: 1 addition & 1 deletion src/sas_datalogger_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ PYBIND11_MODULE(_sas_datalogger, m) {
py::arg("server_count") = 1,
"Returns true if the client is connected to the datalogger server, false otherwise.");

dc.def("log",py::overload_cast<const std::string&, const Eigen::Ref<const MatrixXd>&>(&DC::log),"Logs a matrix or vector.");
dc.def("log",py::overload_cast<const std::string&, const Eigen::Ref<const Eigen::MatrixXd>&>(&DC::log),"Logs a matrix or vector.");
dc.def("log",py::overload_cast<const std::string&, const std::vector<double>&>(&DC::log),"Logs a vector.");
dc.def("log",py::overload_cast<const std::string&, const double&>(&DC::log),"Logs a scalar.");
dc.def("log",py::overload_cast<const std::string&, const std::string&>(&DC::log),"Logs a string.");
Expand Down
Loading