nbv_sim/run_demo.py

24 lines
432 B
Python
Raw Normal View History

import rospy
from controllers import *
2021-03-12 14:55:42 +01:00
from robot_sim import *
from utils import *
gui = True
rospy.init_node("demo")
env = SimPandaEnv(gui)
2021-03-12 14:55:42 +01:00
q, dq = env.arm.get_state()
2021-03-16 17:07:33 +01:00
x0 = env.model.pose(q)
2021-03-18 10:10:56 +01:00
env.controller = CartesianPoseController(env.arm, env.model, x0, 60)
2021-03-12 17:40:59 +01:00
marker = InteractiveMarkerWrapper("target", "panda_link0", x0)
while True:
2021-03-16 17:07:33 +01:00
env.controller.set_target(marker.pose)
2021-03-18 10:10:56 +01:00
env.camera.update()
2021-03-16 17:07:33 +01:00
env.forward(0.1)