Skip to content

Commit

Permalink
vx300 python examples
Browse files Browse the repository at this point in the history
  • Loading branch information
dtotsila committed Aug 30, 2024
1 parent 8ce32ce commit 6799bc5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/examples/python/vx300.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import RobotDART as rd

# @VX300_PYTHON@
robot = rd.Vx300()
# @VX300_PYTHON_END@
robot.set_actuator_types("servo")

ctrl = [0.0, 1.0, -1.5, 1.0, 0.5, 0.]

controller = rd.PDControl(ctrl)
robot.add_controller(controller)

simu = rd.RobotDARTSimu()
simu.set_collision_detector("fcl")

simu.set_graphics(rd.gui.Graphics())
simu.add_robot(robot)
simu.add_checkerboard_floor()

for n in robot.dof_names():
print(n)

simu.run(2.5)

ctrl = [0.0, -0.5, 0.5, -0.5, 0., 1.]
controller.set_parameters(ctrl)
controller.set_pd(20., 0.)
simu.run(2.5)
2 changes: 2 additions & 0 deletions src/examples/vx300.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

int main()
{
// @VX300@
auto robot = std::make_shared<robot_dart::robots::Vx300>();
// @VX300_END@
robot->set_actuator_types("servo");

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

0 comments on commit 6799bc5

Please sign in to comment.