Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_walk_1_real_robot fixes #720

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions soccer_pycontrol/src/soccer_pycontrol/test_walking.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def walker(request) -> Navigator:
config_folder_path = f"{file_path}/../../config/"
config_path = config_folder_path + f"{robot_model}_sim_pybullet.yaml"
set_rosparam_from_yaml_file(param_path=config_path)
set_rosparam_from_yaml_file(param_path=f"{file_path}/../../../{robot_model}_description/config/motor_mapping.yaml")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and then put the rospy.wait_for_message into this

if "DISPLAY" not in os.environ:
c = Navigator(display=False, real_time=False)
else:
Expand Down Expand Up @@ -70,8 +71,10 @@ def walker_real_robot(request) -> NavigatorRos:
config_folder_path = f"{file_path}/../../config/"
config_path = config_folder_path + f"{robot_model}.yaml"
set_rosparam_from_yaml_file(param_path=config_path)
set_rosparam_from_yaml_file(param_path=f"{file_path}/../../../{robot_model}_description/config/motor_mapping.yaml")

c = NavigatorRos()
c.real_time = True
yield c
del c

Expand Down Expand Up @@ -126,16 +129,17 @@ def test_walk_1_ros(self, walker_ros: NavigatorRos):
print(f"Final distance offset {distance_offset}")

@pytest.mark.skip
def test_walk_1_real_robot(self, walker_ros: NavigatorRos):
walker_ros.setPose(Transformation([0.0, 0, 0], [0, 0, 0, 1]))
walker_ros.ready()
walker_ros.wait(200)
@pytest.mark.parametrize("walker_real_robot", ["bez1", "bez3"], indirect=True)
def test_walk_1_real_robot(self, walker_real_robot: NavigatorRos):
walker_real_robot.setPose(Transformation([0.0, 0, 0], [0, 0, 0, 1]))
walker_real_robot.ready()
walker_real_robot.wait(200)
goal_position = Transformation([1, 0, 0], [0, 0, 0, 1])
walker_ros.setGoal(goal_position)
walk_success = walker_ros.run(single_trajectory=True)
walker_real_robot.setGoal(goal_position)
walk_success = walker_real_robot.run(single_trajectory=True)
assert walk_success

final_position = walker_ros.getPose()
final_position = walker_real_robot.getPose()
distance_offset = np.linalg.norm((final_position - goal_position.position)[0:2])

@pytest.mark.timeout(30)
Expand Down