HAPTIX API

 All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
haptix_sim.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
21 
22 #ifndef __HAPTIX_COMM_HAPTIX_SIM_H
23 #define __HAPTIX_COMM_HAPTIX_SIM_H
24 
25 #include "haptix/comm/haptix.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
32 #define hxsMAXCONTACT 30
33 
35 #define hxsMAXBODY 30
36 
40 {
42  int ndynamic;
43 
45  int nstatic;
46 
47  // Anything else we should provide here?
48 };
49 
51 struct _hxsBody
52 {
54  float pos[hxsMAXBODY][3];
55 
57  float quat[hxsMAXBODY][4];
58 
60  float linvel[hxsMAXBODY][3];
61 
63  float angvel[hxsMAXBODY][3];
64 
66  float linacc[hxsMAXBODY][3];
67 
69  float angacc[hxsMAXBODY][3];
70 };
71 
73 struct _hxsJoint
74 {
76  float pos[hxMAXJOINT];
77 
79  float vel[hxMAXJOINT];
80 
82  float acc[hxMAXJOINT];
83 
86 
89 };
90 
93 {
95  int ncontact;
96 
100 
103 
104 
107  float point[hxsMAXCONTACT][3];
108 
111 
114 
117 
118 
122 
125 
127  float force[hxsMAXCONTACT][3];
128 };
129 
132 typedef struct _hxsDeviceInfo hxsDeviceInfo;
133 
136 typedef struct _hxsBody hxsBody;
137 
140 typedef struct _hxsJoint hxsJoint;
141 
144 typedef struct _hxsContact hxsContact;
145 
150 hxResult hxs_getdeviceinfo(int _target,
151  hxsDeviceInfo *_deviceinfo);
152 
157 hxResult hxs_getbody(int _target,
158  hxsBody *_body);
159 
164 hxResult hxs_getjoint(int _target,
165  hxsJoint *_joint);
166 
171 hxResult hxs_getcontact(int _target,
172  hxsContact *_contact);
173 
181 hxResult hxs_getjacobian(int _target,
182  int _link,
183  const float *_point,
184  float *_jacobian);
185 
195 hxResult hxs_setstate(int _target,
196  const hxsBody *_body,
197  const hxsJoint *_joint);
198 
209 hxResult hxs_updatedirect(int _target,
210  const float *_torque,
211  hxSensor *_sensor,
212  int _flg_sleep);
213 
217 hxResult hxs_message(const char *_message);
218 
219 #ifdef __cplusplus
220 }
221 #endif
222 #endif
float angvel[30][3]
Angular velocity (expmap representation).
Definition: haptix_sim.h:63
float acc[hxMAXJOINT]
Acceleration.
Definition: haptix_sim.h:82
float linacc[30][3]
Linear acceleration.
Definition: haptix_sim.h:66
Information about contacts.
Definition: haptix_sim.h:92
float vel[hxMAXJOINT]
Velocity.
Definition: haptix_sim.h:79
Simulated device information, beyond the information provided in hxDeviceInfo.
Definition: haptix_sim.h:39
hxResult hxs_getjacobian(int _target, int _link, const float *_point, float *_jacobian)
Get Jacobian of global point attached to robot link (index between 1 and njoint-1) size of Jacobian m...
float angacc[30][3]
Angular acceleration.
Definition: haptix_sim.h:69
float torque_passive[hxMAXJOINT]
Torque due to limits, damping, friction.
Definition: haptix_sim.h:88
hxResult hxs_message(const char *_message)
Display a text message in the simulator.
Information about bodies.
Definition: haptix_sim.h:51
Information about joints.
Definition: haptix_sim.h:73
hxResult hxs_getbody(int _target, hxsBody *_body)
Get information about bodies.
float distance[30]
Data in contact frame, with axis order (normal, tangent1, tangent2).
Definition: haptix_sim.h:121
float pos[hxMAXJOINT]
Position.
Definition: haptix_sim.h:76
int nstatic
Number of static objects.
Definition: haptix_sim.h:45
hxResult hxs_getcontact(int _target, hxsContact *_contact)
Get information about active contacts.
int body1[30]
Contact descriptors.
Definition: haptix_sim.h:99
hxResult hxs_getjoint(int _target, hxsJoint *_joint)
Get information about joints.
hxResult hxs_getdeviceinfo(int _target, hxsDeviceInfo *_deviceinfo)
Get simulation information.
#define hxMAXJOINT
Maximum number of joints.
Definition: haptix.h:40
hxResult hxs_setstate(int _target, const hxsBody *_body, const hxsJoint *_joint)
Set simulation state (position and velocity) as follows: the robot base and objects are set from hxBo...
#define hxsMAXBODY
Maximum number of bodies.
Definition: haptix_sim.h:35
float torque_motor[hxMAXJOINT]
Torque due to actuation.
Definition: haptix_sim.h:85
float linvel[30][3]
Linear velocity.
Definition: haptix_sim.h:60
float quat[30][4]
Orientation (unit quaternion).
Definition: haptix_sim.h:57
float force[30][3]
Contact force.
Definition: haptix_sim.h:127
float point[30][3]
Contact frame relative to global frame.
Definition: haptix_sim.h:107
float velocity[30][3]
Relative velocity.
Definition: haptix_sim.h:124
#define hxsMAXCONTACT
Maximum number of contacts.
Definition: haptix_sim.h:32
int ndynamic
Number of dynamic objects.
Definition: haptix_sim.h:42
float normal[30][3]
Contact normal (unit vector).
Definition: haptix_sim.h:110
float pos[30][3]
Position.
Definition: haptix_sim.h:54
hxResult hxs_updatedirect(int _target, const float *_torque, hxSensor *_sensor, int _flg_sleep)
Synchronous update with direct torque control:
float tangent1[30][3]
First tangent (unit vector).
Definition: haptix_sim.h:113
hxResult
API return codes.
Definition: haptix.h:60
Structures and functions for the primary HAPTIX API.
int body2[30]
Contacting body 2.
Definition: haptix_sim.h:102
int ncontact
Number of currently active contacts.
Definition: haptix_sim.h:95
float tangent2[30][3]
Second tangent (unit vector).
Definition: haptix_sim.h:116