test:test all refactor code

This commit is contained in:
lgv 2026-07-01 10:41:43 +08:00
parent 94ee690796
commit 4654eee0c4
2 changed files with 19 additions and 17 deletions

View File

@ -7,28 +7,28 @@ device_manager {
id: "mujoco_world" id: "mujoco_world"
type: DEVICE_TYPE_MUJOCO_WORLD type: DEVICE_TYPE_MUJOCO_WORLD
config_file: "devices/mujoco/mujoco_world.pb.txt" config_file: "devices/mujoco/mujoco_world.pb.txt"
enable: true enable: false
} }
devices { devices {
id: "mujoco_motors" id: "mujoco_motors"
type: DEVICE_TYPE_MOTOR_SYSTEM type: DEVICE_TYPE_MOTOR_SYSTEM
config_file: "devices/motor/mujoco_motors.pb.txt" config_file: "devices/motor/mujoco_motors.pb.txt"
enable: true enable: false
} }
devices { devices {
id: "mujoco_right_arm" id: "mujoco_right_arm"
type: DEVICE_TYPE_ROBOT_ARM type: DEVICE_TYPE_ROBOT_ARM
config_file: "devices/arm/arm_mujoco_qp.pb.txt" config_file: "devices/arm/arm_mujoco_qp.pb.txt"
enable: true enable: false
} }
devices { devices {
id: "mujoco_viewer" id: "mujoco_viewer"
type: DEVICE_TYPE_MUJOCO_VIEWER type: DEVICE_TYPE_MUJOCO_VIEWER
config_file: "devices/mujoco/mujoco_viewer.pb.txt" config_file: "devices/mujoco/mujoco_viewer.pb.txt"
enable: true enable: false
} }
devices { devices {
@ -49,7 +49,7 @@ device_manager {
id: "cam5" id: "cam5"
type: DEVICE_TYPE_CAMERA type: DEVICE_TYPE_CAMERA
config_file: "devices/camera/camera.pb.txt" config_file: "devices/camera/camera.pb.txt"
enable: true enable: false
} }
@ -71,14 +71,14 @@ device_manager {
id: "ti5_motors" id: "ti5_motors"
type: DEVICE_TYPE_MOTOR_SYSTEM type: DEVICE_TYPE_MOTOR_SYSTEM
config_file: "devices/motor/ti5_motors.pb.txt" config_file: "devices/motor/ti5_motors.pb.txt"
enable: false enable: true
} }
devices { devices {
id: "right_arm" id: "right_arm"
type: DEVICE_TYPE_ROBOT_ARM type: DEVICE_TYPE_ROBOT_ARM
config_file: "devices/arm/arm.pb.txt" config_file: "devices/arm/arm.pb.txt"
enable: false enable: true
} }
devices { devices {

View File

@ -67,8 +67,8 @@ ManualUiRunResult runManualUiTest(
std::vector<double> q_target = {0, 1, 1.6, 1.6, -2.5, 0.12, 0.12}; std::vector<double> q_target = {0, 1, 1.6, 1.6, -2.5, 0.12, 0.12};
cmvr::device::MotionOptions joint_options; cmvr::device::MotionOptions joint_options;
joint_options.velocity = 5.0; joint_options.velocity = 1.0;
joint_options.acceleration = 15.0; joint_options.acceleration = 5.0;
joint_options.joint_velocity_limits.assign(7, 2.5); joint_options.joint_velocity_limits.assign(7, 2.5);
CMVR_LOG(INFO) << "[MujocoManualUiTest] moveJ " << arm_id; CMVR_LOG(INFO) << "[MujocoManualUiTest] moveJ " << arm_id;
@ -84,13 +84,13 @@ ManualUiRunResult runManualUiTest(
std::this_thread::sleep_for(std::chrono::seconds(1)); std::this_thread::sleep_for(std::chrono::seconds(1));
auto move_l_target = arm->getTcpPose(cmvr::device::FrameType::Base); auto move_l_target = arm->getTcpPose(cmvr::device::FrameType::Base);
move_l_target.z += 0.05; // move_l_target.x += -0.1;
// move_l_target.ry += 0.5; move_l_target.rz += -0.2;
cmvr::device::MotionOptions cartesian_options; cmvr::device::MotionOptions cartesian_options;
cartesian_options.velocity = 0.01; cartesian_options.velocity = 0.1;
cartesian_options.acceleration = 10.0; cartesian_options.acceleration = 5.0;
cartesian_options.jerk = 50.0; cartesian_options.jerk = 10.0;
CMVR_LOG(INFO) << "[MujocoManualUiTest] moveL +X"; CMVR_LOG(INFO) << "[MujocoManualUiTest] moveL +X";
result = arm->moveL(move_l_target, cartesian_options, cmvr::device::FrameType::Base); result = arm->moveL(move_l_target, cartesian_options, cmvr::device::FrameType::Base);
@ -172,6 +172,8 @@ ManualUiRunResult runManualUiTest(
// } // }
// (void)arm->stopL(10); // (void)arm->stopL(10);
// std::this_thread::sleep_for(std::chrono::seconds(1000));
return {}; return {};
} }
@ -217,9 +219,9 @@ TEST(MujocoManualUiTest, RunMujocoArm)
TEST(MujocoManualUiTest, RunRealArm) TEST(MujocoManualUiTest, RunRealArm)
{ {
if (!shouldRunRealArmTest()) { // if (!shouldRunRealArmTest()) {
GTEST_SKIP() << "Set CMVR_RUN_REAL_ARM_TEST=1 to run the real arm manual UI test."; // GTEST_SKIP() << "Set CMVR_RUN_REAL_ARM_TEST=1 to run the real arm manual UI test.";
} // }
cmvr::Runtime runtime; cmvr::Runtime runtime;
ASSERT_TRUE(runtime.init(manualConfigPath())); ASSERT_TRUE(runtime.init(manualConfigPath()));