Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
talos-metapkg-ros-control-sot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
talos-metapkg-ros-control-sot
Commits
2a663a1e
Commit
2a663a1e
authored
7 years ago
by
Olivier Stasse
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
talos_roscontrol_sot/src/roscontrol-sot-controller.cpp
+9
-23
9 additions, 23 deletions
talos_roscontrol_sot/src/roscontrol-sot-controller.cpp
with
9 additions
and
23 deletions
talos_roscontrol_sot/src/roscontrol-sot-controller.cpp
+
9
−
23
View file @
2a663a1e
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment