def test_ros(robot): # SCRIPT PARAMETERS # j = 0 # index of joint under analysis # N = 300 # test duration (in number of timesteps) # dt = 0.001 # time step # estimationDelay = 10 # delay introduced by the estimation [number of time steps] createRosTopics = 1 # 1=true, 0=false # CONSTANTS nj = 30 # number of joints # rad2deg = 180 / 3.14 app = Application(robot) dq_des = nj * (0.0, ) app.robot.device.control.value = dq_des if (createRosTopics == 1): ros = RosExport('rosExport') ros.add('vector', 'robotStateRos', 'state') plug(robot.device.state, ros.robotStateRos) # robot.device.after.addSignal('rosExport.robotStateRos') return ros
def test_ros(robot): # SCRIPT PARAMETERS createRosTopics = 1 # 1=true, 0=false nj = 30 # number of joints app = Application(robot) dq_des = nj * (0.0, ) app.robot.device.control.value = dq_des if (createRosTopics == 1): ros = RosImport('rosImport') ros.add('vector', 'robotStateRos', 'robotState') plug(robot.device.robotState, ros.robotStateRos) robot.device.after.addSignal('rosImport.trigger') return ros