From dc0b22bf31d1b11347be0c9dd9786739faef99fe Mon Sep 17 00:00:00 2001 From: shernand <darwin@darwin.users.iri.prv> Date: Sat, 2 Sep 2017 19:20:04 +0200 Subject: [PATCH] Changed the coding of the roll and pitch shift angles. --- src/darwin_robot.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/darwin_robot.cpp b/src/darwin_robot.cpp index 2336f96..67a32e2 100644 --- a/src/darwin_robot.cpp +++ b/src/darwin_robot.cpp @@ -1990,7 +1990,7 @@ void CDarwinRobot::stairs_set_roll_shift(double angle) if(this->robot_device!=NULL) { - value=(unsigned char)((angle*180.0/PI)*8.0); + value=(unsigned char)((angle*180.0/PI)*4.0); this->robot_device->write_byte_register(DARWIN_STAIRS_R_SHIFT,value); usleep(10000); } @@ -2005,7 +2005,7 @@ double CDarwinRobot::stairs_get_roll_shift(void) if(this->robot_device!=NULL) { this->robot_device->read_byte_register(DARWIN_STAIRS_R_SHIFT,&value); - return (((double)value)*PI/180.0)/8.0; + return (((double)value)*PI/180.0)/4.0; } else throw CDarwinRobotException(_HERE_,"Invalid robot device"); @@ -2017,7 +2017,7 @@ void CDarwinRobot::stairs_set_pitch_shift(double angle) if(this->robot_device!=NULL) { - value=(unsigned char)((angle*180.0/PI)*8.0); + value=(unsigned char)((angle*180.0/PI)*4.0); this->robot_device->write_byte_register(DARWIN_STAIRS_P_SHIFT,value); usleep(10000); } @@ -2032,7 +2032,7 @@ double CDarwinRobot::stairs_get_pitch_shift(void) if(this->robot_device!=NULL) { this->robot_device->read_byte_register(DARWIN_STAIRS_P_SHIFT,&value); - return (((double)value)*PI/180.0)/8.0; + return (((double)value)*PI/180.0)/4.0; } else throw CDarwinRobotException(_HERE_,"Invalid robot device"); -- GitLab