Skip to content

Commit 6799bc5

Browse files
committed
vx300 python examples
1 parent 8ce32ce commit 6799bc5

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/examples/python/vx300.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import RobotDART as rd
2+
3+
# @VX300_PYTHON@
4+
robot = rd.Vx300()
5+
# @VX300_PYTHON_END@
6+
robot.set_actuator_types("servo")
7+
8+
ctrl = [0.0, 1.0, -1.5, 1.0, 0.5, 0.]
9+
10+
controller = rd.PDControl(ctrl)
11+
robot.add_controller(controller)
12+
13+
simu = rd.RobotDARTSimu()
14+
simu.set_collision_detector("fcl")
15+
16+
simu.set_graphics(rd.gui.Graphics())
17+
simu.add_robot(robot)
18+
simu.add_checkerboard_floor()
19+
20+
for n in robot.dof_names():
21+
print(n)
22+
23+
simu.run(2.5)
24+
25+
ctrl = [0.0, -0.5, 0.5, -0.5, 0., 1.]
26+
controller.set_parameters(ctrl)
27+
controller.set_pd(20., 0.)
28+
simu.run(2.5)

src/examples/vx300.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88

99
int main()
1010
{
11+
// @VX300@
1112
auto robot = std::make_shared<robot_dart::robots::Vx300>();
13+
// @VX300_END@
1214
robot->set_actuator_types("servo");
1315

1416
Eigen::VectorXd ctrl = robot_dart::make_vector({0.0, 1.0, -1.5, 1.0, 0.5, 0.});

0 commit comments

Comments
 (0)