Skip to content

Commit f94adca

Browse files
Lu, Bethany (Data61, Pullenvale)Lu, Bethany (Data61, Pullenvale)
authored andcommitted
Merge pull request #20 in OSHC/syropod_highlevel_controller from feature/syropod_manipulation to master
* commit 'fc5fe9cb31808b02817aa908e4f8b0db94e55a5a': Fixed naming in readme Changed syropod_manipulation topic name. Standardised naming to primary and secondary within code and readme Standardised naming to primary and secondary within code and readme Fixed code format removed vscode files Fixed code formart Fixed zero iteration bug Updated the formatting to latest style Updated the formatting of comments Updating formatting to latest style Updated readme to include the new features from SyropodManipulation Added documentation and comments within code added and removed line to see how starting up the robot works updating code, added cubic and quardratic bezier equations Added new function to move the tip position based on direct cartesian input
2 parents 2ca708b + fc5fe9c commit f94adca

File tree

12 files changed

+945
-738
lines changed

12 files changed

+945
-738
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
*.pyc
4141
*.idea
4242
*.sublime*
43+
*.vscode
4344

4445
# Others
4546
*~

include/syropod_highlevel_controller/admittance_controller.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ class AdmittanceController
6161
void updateStiffness(std::shared_ptr<WalkController> walker);
6262

6363
private:
64-
std::shared_ptr<Model> model_; ///< Pointer to the robot model object
65-
const Parameters& params_; ///< Pointer to parameter data structure for storing parameter variables
66-
64+
std::shared_ptr<Model> model_; ///< Pointer to the robot model object
65+
const Parameters &params_; ///< Pointer to parameter data structure for storing parameter variables
66+
6767
public:
6868
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
6969
};
7070

7171
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7272

73-
#endif // SYROPOD_HIGHLEVEL_CONTROLLER_ADMITTANCE_CONTROLLER_H
73+
#endif // SYROPOD_HIGHLEVEL_CONTROLLER_ADMITTANCE_CONTROLLER_H

include/syropod_highlevel_controller/debug_visualiser.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,63 +25,63 @@ class DebugVisualiser
2525
public:
2626
/// Constructor for debug output class. Sets up publishers for the visualisation markers and initialises odometry.
2727
DebugVisualiser(void);
28-
28+
2929
/// Modifier for the time_delta_ member variable.
30-
inline void setTimeDelta(const double& time_delta) { time_delta_ = time_delta; };
30+
inline void setTimeDelta(const double &time_delta) { time_delta_ = time_delta; };
3131

3232
/// Publishes visualisation markers which represent the robot model for display in RVIZ. Consists of line segments.
3333
/// linking the origin points of each joint and tip of each leg.
3434
/// @param[in] model A pointer to the robot model object
3535
void generateRobotModel(std::shared_ptr<Model> model);
36-
36+
3737
/// Publishes visualisation markers which represent the estimated walking plane.
3838
/// @param[in] walk_plane A Vector representing the walk plane
3939
/// @param[in] walk_plane_normal A Vector of the normal to the walk plane
40-
void generateWalkPlane(const Eigen::Vector3d& walk_plane, const Eigen::Vector3d& walk_plane_normal);
40+
void generateWalkPlane(const Eigen::Vector3d &walk_plane, const Eigen::Vector3d &walk_plane_normal);
4141

4242
/// Publishes visualisation markers which represent the trajectory of the tip of the input leg.
4343
/// @param[in] leg A pointer to the leg associated with the tip trajectory that is to be published
4444
void generateTipTrajectory(std::shared_ptr<Leg> leg);
45-
45+
4646
/// Publishes visualisation markers which represent an estimate of the terrain being traversed.
4747
/// @param[in] model A pointer to the robot model object
4848
void generateTerrainEstimate(std::shared_ptr<Model> model);
49-
49+
5050
/// Publishes visualisation markers which represent the control nodes of the three bezier curves used to control tip.
5151
/// trajectory of the input leg.
5252
/// @param[in] leg A pointer to the leg associated with the tip trajectory that is to be published
5353
void generateBezierCurves(std::shared_ptr<Leg> leg);
54-
54+
5555
/// Publishes visualisation markers which represent the default tip position of the leg.
5656
/// @param[in] leg A pointer to a leg of the robot model object
5757
void generateDefaultTipPositions(std::shared_ptr<Leg> leg);
58-
58+
5959
/// Publises visualisation markers which represent the target tip position of the leg.
6060
/// @param[in] leg A pointer to a leg of the robot model object
6161
void generateTargetTipPositions(std::shared_ptr<Leg> leg);
62-
62+
6363
/// Publishes visualisation markers which represent the 2D walkspace for each leg.
6464
/// @param[in] leg A pointer to a leg of the robot model object
6565
/// @param[in] walkspace A map of walkspace radii for a range of bearings to be visualised
66-
void generateWalkspace(std::shared_ptr<Leg> leg, const LimitMap& walkspace);
67-
66+
void generateWalkspace(std::shared_ptr<Leg> leg, const LimitMap &walkspace);
67+
6868
/// Publishes visualisation markers which represent the 3D workspace for each leg.
6969
/// @param[in] leg A pointer to a leg of the robot model object
7070
/// @param[in] body_clearance The vertical offset of the body above the walk plane
71-
void generateWorkspace(std::shared_ptr<Leg> leg, const double& body_clearance);
72-
71+
void generateWorkspace(std::shared_ptr<Leg> leg, const double &body_clearance);
72+
7373
/// Publishes visualisation markers which represent requested stride vector for each leg.
7474
/// @param[in] leg A pointer to the leg associated with the tip trajectory that is to be published
7575
void generateStride(std::shared_ptr<Leg> leg);
76-
76+
7777
/// Publishes visualisation markers which represent the estimated tip force vector for input leg.
7878
/// @param[in] leg A pointer to the leg associated with the tip trajectory that is to be published
7979
void generateTipForce(std::shared_ptr<Leg> leg);
80-
80+
8181
/// Publishes visualisation markers which represent the estimated percentage of max torque in each joint.
8282
/// @param[in] leg A pointer to the leg associated with the tip trajectory that is to be published
8383
void generateJointTorques(std::shared_ptr<Leg> leg);
84-
84+
8585
/// Publishes visualisation markers which represent the estimate of the gravitational acceleration vector.
8686
/// @param[in] gravity_estimate An estimate of the gravitational acceleration vector
8787
void generateGravity(const Eigen::Vector3d& gravity_estimate);
@@ -106,7 +106,7 @@ class DebugVisualiser
106106
int tip_position_id_ = 0; ///< Id for tip trajectory markers
107107
int terrain_marker_id_ = 0; ///< Id for terrain markers
108108
double marker_scale_ = 0.0; ///< Value used to scale marker sizes based on estimate of robot 'size'
109-
109+
110110
public:
111111
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
112112
};

include/syropod_highlevel_controller/parameters_and_states.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ enum SystemState
2626
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2727
enum RobotState
2828
{
29-
PACKED, ///< The robot is in a 'packed' state with all joints at defined 'packed' positions
30-
READY, ///< The robot is in a 'ready' state with all joints at defined 'unpacked' positions
31-
RUNNING, ///< The robot is in a 'running' state. This state is where all posing and walking occurs
32-
ROBOT_STATE_COUNT, ///< Misc enum defining number of Robot States
33-
UNKNOWN = -1, ///< The robot is in an initial 'unknown' state, controller will estimate an actual state from it
34-
OFF = -2, ///< The robot is in 'off' state. Only used as alternative to 'running' state for direct start up
29+
PACKED, ///< The robot is in a 'packed' state with all joints at defined 'packed' positions
30+
READY, ///< The robot is in a 'ready' state with all joints at defined 'unpacked' positions
31+
RUNNING, ///< The robot is in a 'running' state. This state is where all posing and walking occurs
32+
ROBOT_STATE_COUNT, ///< Misc enum defining number of Robot States
33+
UNKNOWN = -1, ///< The robot is in an initial 'unknown' state, controller will estimate an actual state from it
34+
OFF = -2, ///< The robot is in 'off' state. Only used as alternative to 'running' state for direct start up
3535
};
3636

3737
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -88,7 +88,7 @@ enum LegState
8888
{
8989
WALKING, ///< The leg is in a 'walking' state - participates in walking cycle
9090
MANUAL, ///< The leg is in a 'manual' state - able to move via manual manipulation inputs
91-
LEG_STATE_COUNT, ///< Misc enum defining number of LegStates
91+
LEG_STATE_COUNT, ///< Misc enum defining number of LegStates
9292
WALKING_TO_MANUAL = -1, ///< The leg is in 'walking to manual' state - transitioning from 'walking' to 'manual' state
9393
MANUAL_TO_WALKING = -2, ///< The leg is in 'manual to walking' state - transitioning from 'manual' to 'walking' state
9494
};
@@ -199,9 +199,9 @@ struct Parameter
199199
/// @param[in] name_input The unique name of the parameter to look for on ros parameter server
200200
/// @param[in] base_parameter_name The base parameter name prepended to 'name_input' common to all parameters
201201
/// @param[in] required_input Bool denoting if this parameter is required to be initialised
202-
inline void init(const std::string& name_input,
203-
const std::string& base_parameter_name = "/syropod/parameters/",
204-
const bool& required_input = true)
202+
inline void init(const std::string &name_input,
203+
const std::string &base_parameter_name = "/syropod/parameters/",
204+
const bool &required_input = true)
205205
{
206206
ros::NodeHandle n;
207207
name = name_input;
@@ -211,10 +211,10 @@ struct Parameter
211211
" Check config file is loaded and type is correct\n", name.c_str());
212212
}
213213

214-
std::string name; ///< Name of the parameter
215-
T data; ///< Data which defines parameter
216-
bool required = true; ///< Denotes if this parameter is required to be initialised
217-
bool initialised = false; ///< Denotes if this parameter has been initialised
214+
std::string name; ///< Name of the parameter
215+
T data; ///< Data which defines parameter
216+
bool required = true; ///< Denotes if this parameter is required to be initialised
217+
bool initialised = false; ///< Denotes if this parameter has been initialised
218218

219219
public:
220220
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
@@ -383,4 +383,3 @@ struct Parameters
383383
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
384384

385385
#endif // SYROPOD_HIGHLEVEL_CONTROLLER_PARAMETERS_AND_STATES_H
386-

0 commit comments

Comments
 (0)