36 explicit JointItem(
int index, std::vector<yarp::dev::SelectableControlModeEnum> available_modes, QWidget *parent = 0);
129 bool eventFilter(QObject *obj, QEvent *event)
override;
133 void installFilter();
134 void setJointInternalState(
int mode);
135 void setJointInternalInteraction(
int interaction);
137 void updateSliderPosTrajectoryPosition (
double val);
138 void updateSliderPosTrajectoryVelocity (
double val);
139 void updateSliderVelTrajectoryVelocity (
double val);
140 void updateSliderVelTrajectoryAcceleration (
double val);
141 void updateSliderMixedPosition (
double val);
142 void updateSliderPositionDirect (
double val);
143 void updateSliderVelocityDirect (
double val);
144 void updateSliderPWM (
double val);
145 void updateSliderCurrent (
double val);
146 void updateSliderTorque (
double val);
148 void updateTrajectoryPositionTarget (
double val);
149 void updateMixedPositionTarget (
double val);
157 bool sliderVelocityDirectPressed =
false;
158 bool sliderDirectPositionPressed =
false;
159 bool sliderMixedPositionPressed =
false;
160 bool sliderMixedVelocityPressed =
false;
161 bool sliderVelTrajectory_VelocityPressed =
false;
162 bool sliderVelTrajectory_AccelerationPressed =
false;
163 bool sliderPosTrajectory_VelocityPressed =
false;
164 bool sliderPosTrajectory_PositionPressed =
false;
165 bool sliderTorquePressed =
false;
166 bool sliderPWMPressed =
false;
167 bool sliderCurrentPressed =
false;
168 bool motionDone =
true;
169 bool enableCalib =
true;
170 bool joint_speedVisible =
false;
171 bool joint_motorPositionVisible =
false;
172 bool joint_currentVisible =
false;
173 bool joint_dutyVisible =
false;
174 QTimer velocityTimer;
175 QTimer velocityDirectTimer;
176 double lastVelocity = 0;
177 double lastVelocityDirect = 0;
178 bool velocityModeEnabled =
false;
179 bool velocityDirectModeEnabled =
false;
182 bool pwmModeEnabled =
false;
184 double lastCurrent = 0;
185 bool currentModeEnabled =
false;
187 double lastTorque = 0;
188 bool torqueModeEnabled =
false;
192 int POSITION_DIR = 2;
206 double m_max_current = 0;
207 double m_min_current = 0;
208 double m_max_torque = 0;
209 double m_min_torque = 0;
210 double m_max_position = 0;
211 double m_min_position = 0;
212 double m_max_velocity = 0;
213 double m_min_velocity = 0;
214 double m_max_acceleration = 0;
215 double m_min_acceleration = 0;
218 double m_ref_speed = 0;
219 double m_ref_torque = 0;
220 double m_ref_pwm = 0;
221 double m_ref_current = 0;
222 double m_ref_PosTrajectory_velocity = 0;
223 double m_ref_VelTrajectory_acceleration = 0;
228 void onModeChanged(
int index);
229 void onInteractionChanged(
int index);
231 void onSliderPosTrajectory_PositionPressed();
232 void onSliderPosTrajectory_PositionReleased();
234 void onSliderDirectPositionPressed();
235 void onSliderDirectPositionReleased();
237 void onSliderMixedPositionPressed();
238 void onSliderMixedPositionReleased();
240 void onSliderPosTrajectory_VelocityReleased();
241 void onSliderPosTrajectory_VelocityPressed();
243 void onSliderVelTrajectory_AccelerationReleased();
244 void onSliderVelTrajectory_AccelerationPressed();
246 void onSliderMixedVelocityReleased();
247 void onSliderMixedVelocityPressed();
249 void onSliderTorquePressed();
250 void onSliderTorqueReleased();
252 void onSliderCurrentPressed();
253 void onSliderCurrentReleased();
255 void onSliderPWMPressed();
256 void onSliderPWMReleased();
258 void onSliderVelTrajectory_VelocityReleased();
259 void onSliderVelTrajectory_VelocityPressed();
261 void onSliderVelocityDirectReleased();
262 void onSliderVelocityDirectPressed();
264 void onCalibClicked();
265 void onHomeClicked();
266 void onIdleClicked();
269 void onVelocityTimer();
270 void onVelocityDirectTimer();
272 void onCurrentTimer();
273 void onTorqueTimer();
274 void onStackedWidgetChanged(
int);
309 bool eventFilter(QObject *obj, QEvent *event)
override;
define control board standard interfaces
void setMotorPosition(double meas)
void viewPositionTargetValue(bool)
void setVelocityRange(double min, double max)
void setDutyVisible(bool)
void sliderVelocityDirectCommand(double val, int jointIndex)
void updateJointFault(int i, std::string message)
void disableAccelerationSliderDouble()
void enableControlPositionDirect(bool control)
void enableVelocitySliderDoubleAuto()
void setCurrentsVisible(bool)
void setUnits(yarp::dev::JointTypeEnum t)
void setPositionRange(double min, double max)
void enableControlMixed(bool control)
JointState getJointState()
void enablePositionSliderDoubleValue(double value)
void sliderVelTrajectoryAccelerationCommand(double val, int jointIndex)
void sliderCurrentCommand(double val, int jointIndex)
void enableAccelerationSliderDoubleValue(double value)
void enableCurrentSliderDoubleValue(double value)
void viewPositionTargetBox(bool)
void setJointState(JointState)
void sliderPosTrajectoryPositionCommand(double val, int jointIndex)
void enableControlPWM(bool control)
void disablePositionSliderDouble()
void setNumberOfAccelerationSliderDecimals(size_t num)
void disableCurrentSliderDouble()
void enableTorqueSliderDoubleValue(double value)
void homeClicked(JointItem *joint)
static QString JointState2String(JointState mode)
void setPosition(double val)
void sliderPWMCommand(double val, int jointIndex)
void enableControlVelocityDirect(bool control)
void setCurrentRange(double min, double max)
void setJointName(QString name)
void pidClicked(JointItem *joint)
void setPWMRange(double min, double max)
void updateMotionDone(bool done)
void setRefCurrent(double ref)
void setNumberOfCurrentSliderDecimals(size_t num)
double getTrajectoryVelocityValue()
void setVelTrajectory_ReferenceSpeed(double ref)
void setSpeed(double val)
void enableCurrentSliderDoubleAuto()
bool eventFilter(QObject *obj, QEvent *event) override
void sliderMixedPositionCommand(double val, int jointIndex)
void sliderDirectPositionCommand(double val, int jointIndex)
void setJointInteraction(JointInteraction interaction)
void calibClicked(JointItem *joint)
void runClicked(JointItem *joint)
void setMotorPositionVisible(bool)
void enableControlVelocity(bool control)
void setNumberOfTorqueSliderDecimals(size_t num)
void setDutyCycles(double duty)
double getTrajectoryPositionValue()
void sliderPosTrajectoryVelocityCommand(double val, int jointIndex)
void setCurrent(double meas)
static yarp::dev::ControlModeEnum JointState2Mode(JointState mode)
void disableVelocitySliderDouble()
void setPosTrajectory_ReferenceSpeed(double ref)
void updateBraked(bool brk)
void sliderVelTrajectoryVelocityCommand(double val, int jointIndex)
void setRefPWM(double ref)
static QColor JointState2Color(JointState mode)
void sliderTorqueCommand(double val, int jointIndex)
void enableControlCurrent(bool control)
void setEnabledOptions(bool debug_param_enabled, bool speedview_param_enabled, bool enable_calib_all)
void setAccelerationRange(double min, double max)
void changeMode(int mode, JointItem *joint)
void enableTorqueSliderDoubleAuto()
void setVelTrajectory_ReferenceAcceleration(double ref)
void setSpeedVisible(bool)
void setNumberOfPositionSliderDecimals(size_t num)
void enableVelocitySliderDoubleValue(double value)
void enablePositionSliderDoubleAuto()
void disableTorqueSliderDouble()
void setPosTrajectory_ReferencePosition(double ref)
void enableAccelerationSliderDoubleAuto()
void enableControlTorque(bool control)
void setTorque(double meas)
void setNumberOfVelocitySliderDecimals(size_t num)
void sliderMixedVelocityCommand(double val, int jointIndex)
void idleClicked(JointItem *joint)
void setTorqueRange(double max)
void setRefTorque(double ref)
void changeInteraction(int interaction, JointItem *joint)
bool eventFilter(QObject *obj, QEvent *event) override
bool speedview_param_enabled