This shows you the differences between two versions of the page.
|
rasb:lab:05 [2026/07/01 17:37] andrei.batasev |
rasb:lab:05 [2026/07/03 23:38] (current) andrei.batasev |
||
|---|---|---|---|
| Line 15: | Line 15: | ||
| code . | code . | ||
| </code> | </code> | ||
| + | <note tip> | ||
| + | For docker users, you may try to simulate with this setup, {{:rasb:lab:pupper_viz.tar.gz|download this}} and then do these following commands: | ||
| + | <code> | ||
| + | tar -xvf pupper_viz.tar.gz | ||
| + | cd pupper_viz/ | ||
| + | docker build -t pupper_viz . | ||
| + | </code> | ||
| + | Once done, you may paste your forward_kinematics solution into the lab_2.py and then | ||
| + | <code> | ||
| + | ./run.sh | ||
| + | </code> | ||
| + | </note> | ||
| === Step 3. Understanding the Code Structure === | === Step 3. Understanding the Code Structure === | ||
| Before we start implementing the ''TODOs'', let's understand the structure of the ''lab_2.py'' file: | Before we start implementing the ''TODOs'', let's understand the structure of the ''lab_2.py'' file: | ||
| Line 49: | Line 60: | ||
| ==== Part 5: Debugging Your Implementation With RVIZ2 ===== | ==== Part 5: Debugging Your Implementation With RVIZ2 ===== | ||
| - | - Save your changes to ''lab_2.py'' | + | * Save your changes to ''lab_2.py'' |
| - | - Run the ROS2 nodes: | + | * Run the ROS2 nodes: |
| <code> | <code> | ||
| ros2 launch lab_2.launch.py | ros2 launch lab_2.launch.py | ||
| </code> | </code> | ||
| - | - In another terminal, use the following command to run the main code: | + | * In another terminal, use the following command to run the main code: |
| <code> | <code> | ||
| python lab_2.py | python lab_2.py | ||
| </code> | </code> | ||
| - | - Move the left front leg of your robot and observe the changes in the published positions | + | * Move the left front leg of your robot and observe the changes in the published positions |
| To test your code in simulation to make sure that the code works as expected, you can use RVIZ2. RVIZ2 will show the Pupper model as well as a marker that shows the output from the forward kinematics. | To test your code in simulation to make sure that the code works as expected, you can use RVIZ2. RVIZ2 will show the Pupper model as well as a marker that shows the output from the forward kinematics. | ||
| <code> | <code> | ||
| Line 82: | Line 93: | ||
| {{:rasb:lab:base_back_kinematics.png?500|}} | {{:rasb:lab:base_back_kinematics.png?500|}} | ||
| - During the testing with rviz2, write a script that saves the sequence of your well-crafted motion, recorded as end effector positions into a file. You will have a chance to let Pupper replay this recorded motion in the next lab! You will need to use the joint_states topic to record the motor angles, and the leg_front_l_end_effector_position topic to record the end effector positions. | - During the testing with rviz2, write a script that saves the sequence of your well-crafted motion, recorded as end effector positions into a file. You will have a chance to let Pupper replay this recorded motion in the next lab! You will need to use the joint_states topic to record the motor angles, and the leg_front_l_end_effector_position topic to record the end effector positions. | ||
| - | |||