Skip to content
Snippets Groups Projects
Commit c587eda5 authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Move JointAndNJointControllers from RobotUnit/structs.h to...

Move JointAndNJointControllers from RobotUnit/structs.h to RobotUnit/util/JointAndNJointControllers.h
parent 54dc645f
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,7 @@ set(LIB_HEADERS
util/KeyValueVector.h
util/AtomicWrapper.h
util/Time.h
util/JointAndNJointControllers.h
PDController.h
structs.h
Constants.h
......
......@@ -49,6 +49,7 @@
#include "../Devices/SensorDevice.h"
#include "../util.h"
#include "../util/JointAndNJointControllers.h"
#include "../structs.h"
namespace VirtualRobot
......
......@@ -54,6 +54,7 @@
#include "Devices/RTThreadTimingsSensorDevice.h"
#include "util.h"
#include "structs.h"
#include "util/JointAndNJointControllers.h"
#include "RobotUnitObserver.h"
namespace armarx
......
......@@ -43,6 +43,7 @@
#include "SensorValues/SensorValueBase.h"
#include "SensorValues/SensorValueForceTorque.h"
#include "structs.h"
#include "util/JointAndNJointControllers.h"
#include "Units/KinematicSubUnit.h"
#include "Units/RobotUnitSubUnit.h"
#include "Units/PlatformSubUnit.h"
......
......@@ -27,6 +27,7 @@
#include "../util.h"
#include "../structs.h"
#include "../util/JointAndNJointControllers.h"
namespace armarx
{
......
......@@ -49,29 +49,5 @@ namespace armarx
std::vector<std::unique_ptr<SensorValueBase>> sensors;
std::vector<std::vector<std::unique_ptr<ControlTargetBase>>> control;
};
/// @brief Structure used by the RobotUnit to swap lists of Joint and NJoint controllers
struct JointAndNJointControllers
{
JointAndNJointControllers(std::size_t n = 0)
: jointControllers(n),
nJointControllers(n),
jointToNJointControllerAssignement(n, Sentinel())
{}
void resetAssignement()
{
jointToNJointControllerAssignement.assign(jointControllers.size(), Sentinel());
}
std::vector<JointController*> jointControllers;
std::vector<NJointController*> nJointControllers;
/// @brief this is set by RobotUnit::writeRequestedControllers
std::vector<std::size_t> jointToNJointControllerAssignement;
static constexpr std::size_t Sentinel()
{
return std::numeric_limits<std::size_t>::max();
}
};
}
#endif
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package RobotAPI::RobotUnit
* @author Raphael Grimm ( raphael dot grimm at kit dot edu )
* @date 2017
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#ifndef _ARMARX_UNIT_RobotAPI_RobotUnit_JointAndNJointControllers_H
#define _ARMARX_UNIT_RobotAPI_RobotUnit_JointAndNJointControllers_H
#include <vector>
namespace armarx
{
class JointController;
class NJointController;
/// @brief Structure used by the RobotUnit to swap lists of Joint and NJoint controllers
struct JointAndNJointControllers
{
JointAndNJointControllers(std::size_t n = 0)
: jointControllers(n),
nJointControllers(n),
jointToNJointControllerAssignement(n, Sentinel())
{}
void resetAssignement()
{
jointToNJointControllerAssignement.assign(jointControllers.size(), Sentinel());
}
std::vector<JointController*> jointControllers;
std::vector<NJointController*> nJointControllers;
/// @brief this is set by RobotUnit::writeRequestedControllers
std::vector<std::size_t> jointToNJointControllerAssignement;
static constexpr std::size_t Sentinel()
{
return std::numeric_limits<std::size_t>::max();
}
};
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment