Skip to content
Snippets Groups Projects
Commit 2a663a1e authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Changes strategy from c preprocessor to namespace nickname.

Simpler and clearer.
parent 11cdb113
No related branches found
No related tags found
No related merge requests found
...@@ -35,10 +35,13 @@ ...@@ -35,10 +35,13 @@
#define ODEBUG4FULL(x) #define ODEBUG4FULL(x)
#define ODEBUG4(x) #define ODEBUG4(x)
/// lhi: nickname for local_hardware_interface
/// Depends if we are on the real robot or not.
#ifdef REAL_ROBOT #ifdef REAL_ROBOT
using namespace hardware_interface; using namespace lhi=hardware_interface;
#else #else
using namespace talos_hardware_interface; using namespace lhi=talos_hardware_interface;
#endif #endif
using namespace rc_sot_system; using namespace rc_sot_system;
...@@ -47,7 +50,6 @@ namespace talos_sot_controller ...@@ -47,7 +50,6 @@ namespace talos_sot_controller
{ {
typedef std::map<std::string,std::string>::iterator it_map_rt_to_sot; typedef std::map<std::string,std::string>::iterator it_map_rt_to_sot;
-
EffortControlPDMotorControlData::EffortControlPDMotorControlData() EffortControlPDMotorControlData::EffortControlPDMotorControlData()
{ {
prev = 0.0; vel_prev = 0.0; des_pos=0.0; prev = 0.0; vel_prev = 0.0; des_pos=0.0;
...@@ -86,11 +88,7 @@ namespace talos_sot_controller ...@@ -86,11 +88,7 @@ namespace talos_sot_controller
} }
bool RCSotController:: bool RCSotController::
#ifdef REAL_ROBOT initRequest (lhi::RobotHW * robot_hw,
initRequest (hardware_interface::RobotHW * robot_hw,
#else
initRequest (talos_hardware_interface::RobotHW * robot_hw,
#endif
ros::NodeHandle &robot_nh, ros::NodeHandle &robot_nh,
ros::NodeHandle &controller_nh, ros::NodeHandle &controller_nh,
std::set<std::string> & claimed_resources) std::set<std::string> & claimed_resources)
...@@ -129,11 +127,7 @@ namespace talos_sot_controller ...@@ -129,11 +127,7 @@ namespace talos_sot_controller
} }
bool RCSotController:: bool RCSotController::
#ifdef REAL_ROBOT initInterfaces(lhi::RobotHW * robot_hw,
initInterfaces(hardware_interface::RobotHW * robot_hw,
#else
initInterfaces(talos_hardware_interface::RobotHW * robot_hw,
#endif
ros::NodeHandle &, ros::NodeHandle &,
ros::NodeHandle &, ros::NodeHandle &,
std::set<std::string> & claimed_resources) std::set<std::string> & claimed_resources)
...@@ -815,18 +809,10 @@ namespace talos_sot_controller ...@@ -815,18 +809,10 @@ namespace talos_sot_controller
//return type_name_; //return type_name_;
if (control_mode_==POSITION) if (control_mode_==POSITION)
return hardware_interface::internal:: return hardware_interface::internal::
#ifdef REAL_ROBOT demangledTypeName<lhi::PositionJointInterface>();
demangledTypeName<hardware_interface::PositionJointInterface>();
#else
demangledTypeName<talos_hardware_interface::PositionJointInterface>();
#endif
else if (control_mode_==EFFORT) else if (control_mode_==EFFORT)
return hardware_interface::internal:: return hardware_interface::internal::
#ifdef REAL_ROBOT demangledTypeName<lhi::EffortJointInterface>();
demangledTypeName<hardware_interface::EffortJointInterface>();
#else
demangledTypeName<talos_hardware_interface::EffortJointInterface>();
#endif
std::string voidstring(""); std::string voidstring("");
return voidstring; return voidstring;
} }
......
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