humanoid_control_functions.h
Go to the documentation of this file.
1 /**************************************************************************************************
2  Software License Agreement (BSD License)
3 
4  Copyright (c) 2011-2013, LAR toolkit developers - University of Aveiro - http://lars.mec.ua.pt
5  All rights reserved.
6 
7  Redistribution and use in source and binary forms, with or without modification, are permitted
8  provided that the following conditions are met:
9 
10  *Redistributions of source code must retain the above copyright notice, this list of
11  conditions and the following disclaimer.
12  *Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided
14  with the distribution.
15  *Neither the name of the University of Aveiro nor the names of its contributors may be used to
16  endorse or promote products derived from this software without specific prior written permission.
17 
18  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20  FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24  IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 ***************************************************************************************************/
34 #ifndef __HUMANOID_CONTROL_FUNCTIONS_H_
35 #define __HUMANOID_CONTROL_FUNCTIONS_H_
36 
39 #include <phua_haptic/types.h>
40 
41 #include <Eigen/Dense>
42 #include <armadillo>
43 
44 #define PATH_FOLLOWING_POSITION_ERROR 1 //double
45 
46 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~
47 || shared data definition ||
48 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
49 
59 short unsigned int ConvertJointAngleByID(int id, double angle_position);
60 
70 double ConvertServoValueByID(int id, short unsigned int servo_value);
71 
80 void SetRobotHomePosition(shared_vars_t*RobotVars);
81 
89 void UpdateArmsDirKinData(shared_vars_t*RobotVars);
90 
99 
109 void SetArmSpeed(short int SIDE, short int speed, shared_vars_t*RobotVars);
110 
120 void SetLegSpeed(short int SIDE, short int speed, shared_vars_t*RobotVars);
121 
133 void MoveArmToCartesianPosition(double X, double Y, double Z, short int SIDE, shared_vars_t*RobotVars);
134 
147 void MoveDetachedLegToCartesianPosition(double X, double Y, double Z, double t4, short int SIDE, shared_vars_t*RobotVars);
148 
159 void UpdateJointDataByID(short int id, double joint_angle, shared_vars_t*RobotVars);
160 
169 void SetArmAutomaticSpeeds(short int SIDE, shared_vars_t*RobotVars);
170 
179 void CalculateDifferencialArmServoSpeed(double *avg_speed, shared_vars_t*RobotVars);
180 
188 void StopRobotMovement(shared_vars_t*RobotVars);
189 
198 void ArmsDifferencialSpeedControl(double *avg_speed, shared_vars_t*RobotVars);
199 
206 
212 void DemoUserPath_ReadPoints(shared_vars_t*RobotVars);
213 
219 void PathFollowingExecute(shared_vars_t*RobotVars);
220 
227 
228 #endif
229 
types.h file for this module. Contains types and structures used by the application.
void UpdateArmsDirKinData(shared_vars_t *RobotVars)
Function to update the arm end point.
void UpdateKinematicModelDirKin(shared_vars_t *RobotVars)
Function to update shared structure with the current direct kinematic of the robot.
double ConvertServoValueByID(int id, short unsigned int servo_value)
Function to convert a servo value for a given humanoid servo ID.
void DemoUserPath_WritePoints(shared_vars_t *RobotVars)
Function to write points to file.
void PathFollowingExecute(shared_vars_t *RobotVars)
Function to run points read from file.
Shared struture that holds robot/device information.
Definition: types.h:279
void ArmsDifferencialSpeedControl(double *avg_speed, shared_vars_t *RobotVars)
Main robot arm speed control type function.
void SetArmSpeed(short int SIDE, short int speed, shared_vars_t *RobotVars)
Function to set speed to arm servos.
void DemoUserPath_ReadPoints(shared_vars_t *RobotVars)
Function to read points from file.
void UpdateJointDataByID(short int id, double joint_angle, shared_vars_t *RobotVars)
Function to update joint value in the data struture from supplied ID.
void CalculateDifferencialArmServoSpeed(double *avg_speed, shared_vars_t *RobotVars)
Function to calculate joint angular speed given 3d space velocity vector.
void SetLegSpeed(short int SIDE, short int speed, shared_vars_t *RobotVars)
Function to set speed to leg servos.
void StopRobotMovement(shared_vars_t *RobotVars)
Function to stop robot at its current joint configuration.
void UpdateDetachedLegsDirKinData(shared_vars_t *RobotVars)
Function to update the detached legs end point.
void SetRobotHomePosition(shared_vars_t *RobotVars)
Function to send commands to set the robot to its home position.
humanoid_functions.h file for this module. Contains includes, prototypes and defines.
miscellaneous.h file for this module. Contains prototypes, includes and defines.
void SetArmAutomaticSpeeds(short int SIDE, shared_vars_t *RobotVars)
Function set different automatic speeds to arm servomotors.
void MoveDetachedLegToCartesianPosition(double X, double Y, double Z, double t4, short int SIDE, shared_vars_t *RobotVars)
Function to move detached leg end point to given coordinates.
short unsigned int ConvertJointAngleByID(int id, double angle_position)
Function to convert a joint angle for a given humanoid servo ID.
void MoveArmToCartesianPosition(double X, double Y, double Z, short int SIDE, shared_vars_t *RobotVars)
Function to move arm end point to given coordinates.


phua_haptic
Author(s): Pedro Cruz
autogenerated on Mon Mar 2 2015 01:32:36