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
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ci:
autoupdate_branch: 'devel'
repos:
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.8
rev: v21.1.2
hooks:
- id: clang-format
args: [--style=Google]
Expand All @@ -24,8 +24,8 @@ repos:
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 25.1.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.9.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
Expand Down
4 changes: 2 additions & 2 deletions src/sot-pyrene-controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ void SoTPyreneController::startupPython() {
}

extern "C" {
dgsot::AbstractSotExternalInterface *createSotExternalInterface() {
dgsot::AbstractSotExternalInterface* createSotExternalInterface() {
return new SoTPyreneController;
}
}

extern "C" {
void destroySotExternalInterface(dgsot::AbstractSotExternalInterface *p) {
void destroySotExternalInterface(dgsot::AbstractSotExternalInterface* p) {
delete p;
}
}
18 changes: 9 additions & 9 deletions src/sot-talos-controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void SoTTalosController::init() {

// rosInit is called here only to initialize ros.
// No spinner is initialized.
ros::NodeHandle &nh = dynamicgraph::rosInit(false, false);
ros::NodeHandle& nh = dynamicgraph::rosInit(false, false);
interpreter_ = boost::shared_ptr<dynamicgraph::Interpreter>(
new dynamicgraph::Interpreter(nh));

Expand All @@ -59,27 +59,27 @@ SoTTalosController::~SoTTalosController() {
}

void SoTTalosController::setupSetSensors(
map<string, dgsot::SensorValues> &SensorsIn) {
map<string, dgsot::SensorValues>& SensorsIn) {
device_->setupSetSensors(SensorsIn);
}

void SoTTalosController::nominalSetSensors(
map<string, dgsot::SensorValues> &SensorsIn) {
map<string, dgsot::SensorValues>& SensorsIn) {
device_->nominalSetSensors(SensorsIn);
}

void SoTTalosController::cleanupSetSensors(
map<string, dgsot::SensorValues> &SensorsIn) {
map<string, dgsot::SensorValues>& SensorsIn) {
device_->cleanupSetSensors(SensorsIn);
}

void SoTTalosController::getControl(
map<string, dgsot::ControlValues> &controlOut) {
map<string, dgsot::ControlValues>& controlOut) {
try {
sotDEBUG(25) << __FILE__ << __FUNCTION__ << "(#" << __LINE__ << ")" << endl;
device_->getControl(controlOut);
sotDEBUG(25) << __FILE__ << __FUNCTION__ << "(#" << __LINE__ << ")" << endl;
} catch (dynamicgraph::sot::ExceptionAbstract &err) {
} catch (dynamicgraph::sot::ExceptionAbstract& err) {
std::cout << __FILE__ << " " << __FUNCTION__ << " (" << __LINE__ << ") "
<< err.getStringMessage() << endl;
throw err;
Expand All @@ -92,9 +92,9 @@ void SoTTalosController::setSecondOrderIntegration(void) {
device_->setSecondOrderIntegration();
}

void SoTTalosController::runPython(std::ostream &file,
const std::string &command,
dynamicgraph::Interpreter &interpreter) {
void SoTTalosController::runPython(std::ostream& file,
const std::string& command,
dynamicgraph::Interpreter& interpreter) {
file << ">>> " << command << std::endl;
std::string lres(""), lout(""), lerr("");
interpreter.runCommand(command, lres, lout, lerr);
Expand Down
16 changes: 8 additions & 8 deletions src/sot-talos-controller.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ class SoTTalosController : public dgsot::AbstractSotExternalInterface {
SoTTalosController(std::string robotName);
virtual ~SoTTalosController();

void setupSetSensors(std::map<std::string, dgsot::SensorValues> &sensorsIn);
void setupSetSensors(std::map<std::string, dgsot::SensorValues>& sensorsIn);

void nominalSetSensors(std::map<std::string, dgsot::SensorValues> &sensorsIn);
void nominalSetSensors(std::map<std::string, dgsot::SensorValues>& sensorsIn);

void cleanupSetSensors(std::map<std::string, dgsot::SensorValues> &sensorsIn);
void cleanupSetSensors(std::map<std::string, dgsot::SensorValues>& sensorsIn);

void getControl(std::map<std::string, dgsot::ControlValues> &anglesOut);
void getControl(std::map<std::string, dgsot::ControlValues>& anglesOut);

void setNoIntegration(void);
void setSecondOrderIntegration(void);
Expand All @@ -53,17 +53,17 @@ class SoTTalosController : public dgsot::AbstractSotExternalInterface {
protected:
// Update output port with the control computed from the
// dynamic graph.
void updateRobotState(std::vector<double> &anglesIn);
void updateRobotState(std::vector<double>& anglesIn);

/// Run a python command
void runPython(std::ostream &file, const std::string &command,
dynamicgraph::Interpreter &interpreter);
void runPython(std::ostream& file, const std::string& command,
dynamicgraph::Interpreter& interpreter);

virtual void startupPython();

void init();

SoTTalosDevice *device_;
SoTTalosDevice* device_;
};

#endif /* _SOT_TalosController_H_ */
24 changes: 12 additions & 12 deletions src/sot-talos-device.hh
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@ class SoTTalosDevice : public dgsot::Device {
static const std::string CLASS_NAME;
static const double TIMESTEP_DEFAULT;

virtual const std::string &getClassName() const { return CLASS_NAME; }
virtual const std::string& getClassName() const { return CLASS_NAME; }

SoTTalosDevice(std::string RobotName);
virtual ~SoTTalosDevice();

void setSensors(std::map<std::string, dgsot::SensorValues> &sensorsIn);
void setSensors(std::map<std::string, dgsot::SensorValues>& sensorsIn);

void setupSetSensors(std::map<std::string, dgsot::SensorValues> &sensorsIn);
void setupSetSensors(std::map<std::string, dgsot::SensorValues>& sensorsIn);

void nominalSetSensors(std::map<std::string, dgsot::SensorValues> &sensorsIn);
void nominalSetSensors(std::map<std::string, dgsot::SensorValues>& sensorsIn);

void cleanupSetSensors(std::map<std::string, dgsot::SensorValues> &sensorsIn);
void cleanupSetSensors(std::map<std::string, dgsot::SensorValues>& sensorsIn);

void getControl(std::map<std::string, dgsot::ControlValues> &anglesOut);
void getControl(std::map<std::string, dgsot::ControlValues>& anglesOut);

void timeStep(double ts) { timestep_ = ts; }

Expand Down Expand Up @@ -76,17 +76,17 @@ class SoTTalosDevice : public dgsot::Device {
dynamicgraph::Signal<dg::Vector, int> d_gainsSOUT_;

/// Protected methods for internal variables filling
void setSensorsForce(std::map<std::string, dgsot::SensorValues> &SensorsIn,
void setSensorsForce(std::map<std::string, dgsot::SensorValues>& SensorsIn,
int t);
void setSensorsIMU(std::map<std::string, dgsot::SensorValues> &SensorsIn,
void setSensorsIMU(std::map<std::string, dgsot::SensorValues>& SensorsIn,
int t);
void setSensorsEncoders(std::map<std::string, dgsot::SensorValues> &SensorsIn,
void setSensorsEncoders(std::map<std::string, dgsot::SensorValues>& SensorsIn,
int t);
void setSensorsVelocities(
std::map<std::string, dgsot::SensorValues> &SensorsIn, int t);
std::map<std::string, dgsot::SensorValues>& SensorsIn, int t);
void setSensorsTorquesCurrents(
std::map<std::string, dgsot::SensorValues> &SensorsIn, int t);
void setSensorsGains(std::map<std::string, dgsot::SensorValues> &SensorsIn,
std::map<std::string, dgsot::SensorValues>& SensorsIn, int t);
void setSensorsGains(std::map<std::string, dgsot::SensorValues>& SensorsIn,
int t);

/// Intermediate variables to avoid allocation during control
Expand Down