Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Q
quadruped-reactive-walking
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
Gepetto
quadruped-reactive-walking
Commits
a7212f5d
Commit
a7212f5d
authored
3 years ago
by
Pierre-Alexandre Leziart
Browse files
Options
Downloads
Patches
Plain Diff
Adding fake robot class for debug purpose
parent
91793997
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-0
1 addition, 0 deletions
CMakeLists.txt
include/qrw/FakeRobot.hpp
+94
-0
94 additions, 0 deletions
include/qrw/FakeRobot.hpp
src/control_solo12.cpp
+4
-2
4 additions, 2 deletions
src/control_solo12.cpp
with
99 additions
and
2 deletions
CMakeLists.txt
+
1
−
0
View file @
a7212f5d
...
...
@@ -62,6 +62,7 @@ set(${PROJECT_NAME}_HEADERS
include/qrw/Filter.hpp
include/qrw/Controller.hpp
include/qrw/MpcWrapper.hpp
include/qrw/FakeRobot.hpp
include/other/st_to_cc.hpp
)
...
...
This diff is collapsed.
Click to expand it.
include/qrw/FakeRobot.hpp
0 → 100644
+
94
−
0
View file @
a7212f5d
///////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief This is the header for FakeRobot class
///
/// \details Create a fake robot object for debug purpose
///
//////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef FAKEROBOT_H_INCLUDED
#define FAKEROBOT_H_INCLUDED
#include
<Eigen/Core>
#include
<Eigen/Dense>
#include
"qrw/Types.h"
class
FakeRobot
{
public:
////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Constructor
///
////////////////////////////////////////////////////////////////////////////////////////////////
FakeRobot
();
////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Destructor
///
////////////////////////////////////////////////////////////////////////////////////////////////
~
FakeRobot
()
{}
// Empty destructor
// Fake functions
void
Initialize
(
Vector12
const
&
des_pos
)
{}
void
ParseSensorData
()
{}
void
SendCommandAndWaitEndOfCycle
(
double
dt
)
{}
FakeJoints
*
joints
=
new
FakeJoints
();
FakeImu
*
imu
=
new
FakeImu
();
};
class
FakeJoints
{
public:
////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Constructor
///
////////////////////////////////////////////////////////////////////////////////////////////////
FakeJoints
();
////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Destructor
///
////////////////////////////////////////////////////////////////////////////////////////////////
~
FakeJoints
()
{}
// Empty destructor
// Fake functions
void
PrintVector
()
{}
void
SetZeroCommands
()
{}
Vector12
GetPositions
()
{
return
Vector12
::
Zero
();
}
Vector12
GetVelocities
()
{
return
Vector12
::
Zero
();
}
void
SetPositionGains
(
Vector12
const
&
data
)
{}
void
SetVelocityGains
(
Vector12
const
&
data
)
{}
void
SetDesiredPositions
(
Vector12
const
&
data
)
{}
void
SetDesiredVelocities
(
Vector12
const
&
data
)
{}
void
SetTorques
(
Vector12
const
&
data
)
{}
};
class
FakeImu
{
public:
////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Constructor
///
////////////////////////////////////////////////////////////////////////////////////////////////
FakeImu
();
////////////////////////////////////////////////////////////////////////////////////////////////
///
/// \brief Destructor
///
////////////////////////////////////////////////////////////////////////////////////////////////
~
FakeImu
()
{}
// Empty destructor
// Fake functions
Vector12
GetLinearAcceleration
()
{
return
Vector12
::
Zero
();
}
Vector12
GetGyroscope
()
{
return
Vector12
::
Zero
();
}
Vector12
GetAttitudeEuler
()
{
return
Vector12
::
Zero
();
}
};
#endif // FAKEROBOT_H_INCLUDED
This diff is collapsed.
Click to expand it.
src/control_solo12.cpp
+
4
−
2
View file @
a7212f5d
...
...
@@ -5,13 +5,14 @@
#include
"qrw/Types.h"
#include
"qrw/Params.hpp"
#include
"qrw/Controller.hpp"
#include
"qrw/FakeRobot.hpp"
using
namespace
odri_control_interface
;
#include
<iostream>
#include
<stdexcept>
int
put_on_the_floor
(
std
::
shared_ptr
<
Robot
>
robot
,
Vector12
const
&
q_init
)
int
put_on_the_floor
(
std
::
shared_ptr
<
Fake
Robot
>
robot
,
Vector12
const
&
q_init
)
{
/*Make the robot go to the default initial position and wait for the user
to press the Enter key to start the main control loop
...
...
@@ -55,7 +56,8 @@ int main()
Params
params
=
Params
();
// Define the robot from a yaml file.
std
::
shared_ptr
<
Robot
>
robot
=
RobotFromYamlFile
(
CONFIG_SOLO12_YAML
);
// std::shared_ptr<Robot> robot = RobotFromYamlFile(CONFIG_SOLO12_YAML);
std
::
shared_ptr
<
FakeRobot
>
robot
=
std
::
make_shared
<
FakeRobot
>
();
// Store initial position data.
Vector12
des_pos
;
...
...
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