test_Gravity.py
Go to the documentation of this file.
1 from pathlib import Path
2 
3 import pinocchio as se3
4 import tsid
5 
6 print("")
7 print("Test setGravity")
8 print("")
9 
10 
11 filename = str(Path(__file__).resolve().parent)
12 path = filename + "/../../models/romeo"
13 urdf = path + "/urdf/romeo.urdf"
14 vector = se3.StdVec_StdString()
15 vector.extend(item for item in path)
16 
17 robot = tsid.RobotWrapper(urdf, vector, se3.JointModelFreeFlyer(), False)
18 
19 init_gravity = robot.model().gravity.copy()
20 
21 robot.setGravity(se3.Motion.Zero())
22 
23 no_gravity = robot.model().gravity.copy()
24 
25 print(init_gravity)
26 print(no_gravity)
27 
28 assert init_gravity != no_gravity
29 
30 print("All test is done")


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sat May 3 2025 02:48:17