Skip to content
Snippets Groups Projects

Debug features for GamepadUnit

Open Tobias Gröger requested to merge feature/debug-gamepad-unit into master
@@ -41,6 +41,8 @@ namespace armarx
scaleY = getProperty<float>("ScaleY").getValue();
scaleRotation = getProperty<float>("ScaleAngle").getValue();
ARMARX_INFO << "oninit GamepadControlUnit end";
DebugObserverComponentPluginUser::setDebugObserverBatchModeEnabled(true);
}
void
@@ -55,9 +57,9 @@ namespace armarx
if (enableHeartBeat)
{
this->heartbeatPlugin->signUp(armarx::core::time::Duration::MilliSeconds(1000),
armarx::core::time::Duration::MilliSeconds(1500),
{"Gamepad"},
"The GamepadControlUnit");
armarx::core::time::Duration::MilliSeconds(1500),
{"Gamepad"},
"The GamepadControlUnit");
}
}
@@ -80,6 +82,8 @@ namespace armarx
defs->optional(enableHeartBeat,
"EnableHeartBeat",
"Flag to enable send a heart beat to the robot healh topic");
defs->optional(
enableDebugObserver, "EnableDebugObserver", "Send gamepad data to debug observer");
return defs;
}
@@ -189,6 +193,22 @@ namespace armarx
}
if (enableDebugObserver)
{
// send data to debug observer
auto debugObserver = getDebugObserverComponentPlugin();
const std::string channel = "Gamepad";
debugObserver.setDebugObserverDatafield(channel, "rawEnabled", data.rightTrigger);
debugObserver.setDebugObserverDatafield(channel, "rawX", data.leftStickY);
debugObserver.setDebugObserverDatafield(channel, "rawY", data.leftStickX);
debugObserver.setDebugObserverDatafield(channel, "rawRot", data.rightStickX);
debugObserver.sendDebugObserverBatch();
}
if (enableHeartBeat)
{
auto now = armarx::core::time::dto::DateTime();
Loading