Skip to content

Commit

Permalink
Changed gazebo omni drive kinematics
Browse files Browse the repository at this point in the history
now drive straight chen cmd_vel = x
  • Loading branch information
VincidaB committed Jan 29, 2024
1 parent a01a1ba commit e394248
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
10 changes: 9 additions & 1 deletion gazebo/omniRobot_plugin/src/gazebo_omni_drive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,19 @@ void GazeboOmniRosDrivePrivate::UpdateWheelVelocities()
double va = target_rot_;

for (unsigned int i = 0; i < num_wheel_pairs_; ++i)
{
{
/*
desired_wheel_speed_[2 * i + NORTH] = (vx + vy - va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2;
desired_wheel_speed_[2 * i + WEST] = (vx - vy - va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2;
desired_wheel_speed_[2 * i + SOUTH] = (vx + vy + va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2;
desired_wheel_speed_[2 * i + EAST] = (vx - vy + va * (wheel_w_separation_[i] + wheel_l_separation_[i]) / 2.0) / wheel_diameter_[i] * 2;
*/
double wl = va * (wheel_w_separation_[i] + wheel_l_separation_[i]) ;
desired_wheel_speed_[2 * i + NORTH] = (-wl - vy) / wheel_diameter_[i] * 2;
desired_wheel_speed_[2 * i + WEST] = (-wl + vx) / wheel_diameter_[i] * 2;
desired_wheel_speed_[2 * i + SOUTH] = (wl - vy) / wheel_diameter_[i] * 2;
desired_wheel_speed_[2 * i + EAST] = (wl + vx) / wheel_diameter_[i] * 2;

}
}

Expand Down
13 changes: 9 additions & 4 deletions src/ezbot_descr_simul/description/robot_core.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@
<surface>
<contact>
<ode>
<min_depth>0.01</min_depth>
<max_vel>0</max_vel>
<min_depth>0.02</min_depth>
</ode>
</contact>
</surface>
Expand Down Expand Up @@ -300,7 +301,9 @@
<surface>
<contact>
<ode>
<min_depth>0.01</min_depth>
<max_vel>0</max_vel>

<min_depth>0.02</min_depth>
</ode>
</contact>
</surface>
Expand Down Expand Up @@ -343,7 +346,8 @@
<surface>
<contact>
<ode>
<min_depth>0.01</min_depth>
<max_vel>0</max_vel>
<min_depth>0.02</min_depth>
</ode>
</contact>
</surface>
Expand Down Expand Up @@ -386,7 +390,8 @@
<surface>
<contact>
<ode>
<min_depth>0.01</min_depth>
<max_vel>0</max_vel>
<min_depth>0.02</min_depth>
</ode>
</contact>
</surface>
Expand Down

0 comments on commit e394248

Please sign in to comment.