Skip to content

Commit ca27361

Browse files
authored
Merge pull request #39 from BCLab-UNM/bug-simulationdriving
Robots able to drive in sim using the PID values in driveController. This fixes a problem introduced in sim when the PIDs were tuned for hardware.
2 parents a04b4e4 + 5cd0b62 commit ca27361

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/behaviours/src/DriveController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DriveController : virtual Controller
2929

3030
bool interupt = false;
3131

32-
float rotateOnlyAngleTolerance = 0.1;
32+
float rotateOnlyAngleTolerance = 0.15;
3333
float finalRotationTolerance = 0.2;
3434
const float waypointTolerance = 0.15; //15 cm tolerance.
3535

src/sbridge/src/sbridge.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void sbridge::cmdHandler(const geometry_msgs::Twist::ConstPtr& message) {
2424
double left = (message->linear.x);
2525
double right = (message->angular.z);
2626

27-
float max_turn_rate = 3.14; //radians per second
27+
float max_turn_rate = 4.5; //radians per second
2828
float max_linear_velocity = 0.6; // meters per second
2929

3030
float turn = 0;
@@ -47,8 +47,8 @@ void sbridge::cmdHandler(const geometry_msgs::Twist::ConstPtr& message) {
4747
float linearVel = (left + right)/2;
4848
float angularVel = (right-left)/2;
4949

50-
turn = angularVel/180;
51-
forward = linearVel/400;
50+
turn = angularVel/55;
51+
forward = linearVel/425;
5252
if (forward >= 150){
5353

5454
forward -= (abs(turn)/5);

0 commit comments

Comments
 (0)