From 353fe1862dab28240714d862e84d217b2765bf94 Mon Sep 17 00:00:00 2001 From: Sharwin24 Date: Wed, 8 Jan 2025 17:13:07 -0600 Subject: [PATCH] More content and editing config link --- config.yaml | 5 +- content/posts/mobile-manipulation/index.md | 88 ++++++++++++++++++++-- content/posts/toastbot/index.md | 17 +++-- go.mod | 2 +- layouts/partials/footer.html | 2 +- 5 files changed, 97 insertions(+), 17 deletions(-) diff --git a/config.yaml b/config.yaml index 89ba44d..56d8437 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -baseURL: "https://sharwin24.github.io/toha/" +baseURL: "https://sharwin24.github.io/toha" languageCode: "en-us" title: "Sharwin's Portfolio" @@ -39,7 +39,6 @@ module: - source: ../../node_modules/katex/dist/fonts target: static/fonts - markup: defaultMarkdownHandler: goldmark goldmark: @@ -114,7 +113,7 @@ params: favicon: /images/sharwin_portrait.jpg # GitHub repo of your site - gitRepo: https://github.com/Sharwin24/toha + gitRepo: https://github.com/Sharwin24/sharwin24.github.io # Default branch of your Git repo gitBranch: main diff --git a/content/posts/mobile-manipulation/index.md b/content/posts/mobile-manipulation/index.md index 582f4b7..1c3060f 100644 --- a/content/posts/mobile-manipulation/index.md +++ b/content/posts/mobile-manipulation/index.md @@ -18,16 +18,13 @@ This project incorporates several robotics concepts to perform a pick and place
- Robot + Robot
## Omnidirectional Mobile Base Kinematics (Mecanum Wheels) This robot uses mecanum wheels, which are omnidirectional wheels with 45-degree rollers that allow the robot to move in any direction without changing its orientation. When controlling the robot, we command the wheel velocities, which can be described by the following equation: -$$ -u_i=\frac{1}{r_i}\overbrace{\begin{bmatrix}1 & \tan\gamma_i\end{bmatrix}}^{\text{driving direction}}\underbrace{\begin{bmatrix}\cos\beta_i & \sin\beta_i \\\ -\sin\beta_i & \cos\beta_i\end{bmatrix}}_{\text{linear velocity in wheel frame}} -\overbrace{\begin{bmatrix}-y_i & 1 & 0 \\\ x_i & 0 & 1\end{bmatrix}}^{\text{linear velocity in body frame}} V_b -$$ +$$ u_i=\frac{1}{r_i}\overbrace{\begin{bmatrix}1 & \tan\gamma_i\end{bmatrix}}^{\text{driving direction}}\underbrace{\begin{bmatrix}\cos\beta_i & \sin\beta_i \\\ -\sin\beta_i & \cos\beta_i\end{bmatrix}}_{\text{linear velocity in wheel frame}} \overbrace{\begin{bmatrix}-y_i & 1 & 0 \\\ x_i & 0 & 1\end{bmatrix}}^{\text{linear velocity in body frame}} V_b $$ where: - \\(u_i\\) is the wheel velocity @@ -38,12 +35,89 @@ where: - \\(V_b\\) is the robot's 3D body twist, composed of the linear and angular velocity: \\([v_x, v_y, \omega]\\) -
+
Mecanum Base
## Trajectory Generation -There were two +There were two components to the trajectory generation: + +1. End-Effector Reference Trajectory: Generating a desired end-effector trajectory for the robot to follow. +2. Time allocation: Generating the time and number of simulation steps per trajectory segment based on the desired end-effector trajectory. + +These were accomplished using the trajectory generation functions provided by the `modern_robotics` library after splitting the sequence into 8 separate segments. + +```python +dt = 0.01 # [s] +total_time = 10 # [s] +traj_1_time = 0.21 * total_time # Initial -> Pick_Standoff +traj_2_time = 0.01 * total_time # Pick_Standoff -> Cube_Initial +traj_3_time = 0.07 * total_time # Cube_Initial -> Gripper Closed +traj_4_time = 0.21 * total_time # Gripper Closed -> Pick_Standoff +traj_5_time = 0.21 * total_time # Pick_Standoff -> Place_Standoff +traj_6_time = 0.01 * total_time # Place_Standoff -> Cube_Final +traj_7_time = 0.07 * total_time # Cube_Final -> Gripper Open +traj_8_time = 0.21 * total_time # Gripper Open -> Place_Standoff +trajectory_time = np.array([ + traj_1_time, traj_2_time, traj_3_time, traj_4_time, + traj_5_time, traj_6_time, traj_7_time, traj_8_time +]) +# steps per trajectory segment +# traj_steps = int(total_time * num_reference_configs / dt) +traj_steps = [ + int(t * num_reference_configs / dt) for t in trajectory_time +] +# Apply transformations for the waypoints we'll need +pick_standoff_config = cube_initial_config @ standoff_config +place_standoff_config = cube_final_config @ standoff_config +pick_grasp_config = cube_initial_config @ ee_grasping_config +place_grasp_config = cube_final_config @ ee_grasping_config +# Gripper states for the trajectory +gripper_states = [] +# Trajectory 1: Initial -> Pick_Standoff (Screw Trajectory) +gripper_states.extend([0] * traj_steps[0]) +traj_1 = mr.ScrewTrajectory( + ee_initial_config, pick_standoff_config, trajectory_time[0], traj_steps[0], method=3 +) +# Trajectory 2: Pick_Standoff -> Cube_Initial (Cartesian Trajectory) +gripper_states.extend([0] * traj_steps[1]) +traj_2 = mr.CartesianTrajectory( + pick_standoff_config, pick_grasp_config, trajectory_time[1], traj_steps[1], method=3 +) +# Trajectory 3: Cube_Initial -> Gripper Closed +gripper_states.extend([1] * traj_steps[2]) +traj_3 = mr.ScrewTrajectory( + pick_grasp_config, pick_grasp_config, trajectory_time[2], traj_steps[2], method=3 +) +# Trajectory 4: Gripper Closed -> Pick_Standoff (Cartesian Trajectory) +gripper_states.extend([1] * traj_steps[3]) +traj_4 = mr.CartesianTrajectory( + pick_grasp_config, pick_standoff_config, trajectory_time[3], traj_steps[3], method=3 +) +# Trajectory 5: Pick_Standoff -> Place_Standoff (Screw Trajectory) +gripper_states.extend([1] * traj_steps[4]) +traj_5 = mr.ScrewTrajectory( + pick_standoff_config, place_standoff_config, trajectory_time[4], traj_steps[4], method=3 +) +# Trajectory 6: Place_Standoff -> Cube_Final (Cartesian Trajectory) +gripper_states.extend([1] * traj_steps[5]) +traj_6 = mr.CartesianTrajectory( + place_standoff_config, place_grasp_config, trajectory_time[5], traj_steps[5], method=3 +) +# Trajectory 7: Cube_Final -> Gripper Open +gripper_states.extend([0] * traj_steps[6]) +traj_7 = mr.ScrewTrajectory( + place_grasp_config, place_grasp_config, trajectory_time[6], traj_steps[6], method=3 +) +# Trajectory 8: Gripper Open -> Place_Standoff +gripper_states.extend([0] * traj_steps[7]) +traj_8 = mr.CartesianTrajectory( + place_grasp_config, place_standoff_config, trajectory_time[7], traj_steps[7], method=3 +) +trajectory = np.concatenate( + (traj_1, traj_2, traj_3, traj_4, traj_5, traj_6, traj_7, traj_8), axis=0 +) +``` ## Odometry Odometry is the process of estimating the mobile robot's pose by integrating the wheel velocities. The robot's pose is represented by the chassis configuration \\([\phi, x, y]\\), where \\(\phi\\) is the orientation and \\(x, y\\) are the position in the world frame. We can compute the body twist \\(V_b\\) using the wheel velocities \\(\dot{\theta}\\), the timestep \\(\Delta t\\), and the chassis configuration \\( F=pinv(H(0))\\): diff --git a/content/posts/toastbot/index.md b/content/posts/toastbot/index.md index ba7240b..5d564fa 100644 --- a/content/posts/toastbot/index.md +++ b/content/posts/toastbot/index.md @@ -1,7 +1,7 @@ --- title: "ToastBot" -date: 2025-01-05T09:00:00+00:00 -description: Introduction to Sample Post +date: 2024-12-12T09:00:00+00:00 +description: Pick and Place Sequence using the Franka Emika Panda Robot Arm hero: images/toastbot.jpg author: image: /images/sharwin_portrait.jpg @@ -10,6 +10,13 @@ menu: name: Toastbot identifier: ToastBot weight: 2 -tags: ["Basic", "Multi-lingual"] -categories: ["Basic"] ---- \ No newline at end of file +tags: ["Python", "ROS", "Moveit API", "Intel Realsense"] +# categories: ["Basic"] +--- + +Using a 7-DoF Franka Emika Panda Robot Arm, we developed a pick and place sequence using an Intel Realsense camera for identifying april tags. + + +
+ +
\ No newline at end of file diff --git a/go.mod b/go.mod index 07fe357..df82406 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.21 replace( - github.com/hugo-toha/toha/v4 => /home/sharwin/web-dev/toha + github.com/hugo-toha/toha/v4 => /home/sharwin/sharwin24.github.io/ ) diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 74efaf3..12f85e6 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -126,7 +126,7 @@ {{ if $newsletterEnabled }} {{ $provider := site.Params.footer.newsletter.provider }} - + {{ end }}