Skip to content
Snippets Groups Projects
Commit 149a89b4 authored by Hoop77's avatar Hoop77
Browse files

-

parent f60a77d4
Branches
No related merge requests found
......@@ -19,6 +19,8 @@
#include "../mavlink.h"
#include "app/leddebug.h"
#define ABS(x) (x < 0 ? -x : x)
/************* Private typedefs ***********************************************************/
#define NUM_MSGS (sizeof mavlinkMessageInfo / sizeof mavlinkMessageInfo[0])
......@@ -128,7 +130,7 @@ bool sendMessage(uint8_t msgid)
mavlink_msg_error_pack(mavlinkSystem.sysid, mavlinkSystem.compid, &msg, *pErrorRegister_mavlink);
break;
case MAVLINK_MSG_ID_ODOMETRY:
mavlink_msg_odometry_pack(mavlinkSystem.sysid, mavlinkSystem.compid, &msg, *pOdomTimestamp_mavlink - syncOffset, *pStAngTimestamp_mavlink - syncOffset, *pVehSpdOdom_mavlink, *pVehXDistOdom_mavlink, *pVehYDistOdom_mavlink, *pVehYawAngOdom_mavlink, *pStAngAct_mavlink);
mavlink_msg_odometry_pack(mavlinkSystem.sysid, mavlinkSystem.compid, &msg, *pOdomTimestamp_mavlink - syncOffset, *pStAngTimestamp_mavlink - syncOffset, ABS(*pVehSpdOdom_mavlink), *pVehXDistOdom_mavlink, *pVehYDistOdom_mavlink, *pVehYawAngOdom_mavlink, *pStAngAct_mavlink);
//mavlink_msg_odometry_pack(mavlinkSystem.sysid, mavlinkSystem.compid, &msg, *pOdomTimestamp_mavlink - syncOffset, *pStAngTimestamp_mavlink - syncOffset, *pMotTrqTgtSrv_mavlink, *pVehXDistOdom_mavlink, *pVehYDistOdom_mavlink, *pVehYawAngOdom_mavlink, *pStAngAct_mavlink);
break;
case MAVLINK_MSG_ID_CMD_REQUEST_CLOCKSYNC:
......
......@@ -54,10 +54,11 @@ float *pMotTrqTgtSrv_vehspdctrl;
#define U_DEADBAND_POSITIVE 0.001
#define U_DEADBAND_NEGATIVE -U_DEADBAND_POSITIVE * 4
#define MOTOR_LIMIT 0.085f
#define MOTOR_LIMIT 0.12f
#define MOTOR_FULLSTOP -10
#define MIN(a, b) (a < b ? a : b)
#define ABS(x) (x < 0 ? -x : x)
/************* Private static variables ***************************************************/
static pidCtrl_t pid;
......@@ -198,7 +199,7 @@ float updateMotTrqTgtSrv(float destSpeed)
float currSpeed = 0; // controlled value
irq_disable();
currSpeed = *pVehSpdOdom_vehspdctrl;
currSpeed = ABS(*pVehSpdOdom_vehspdctrl);
irq_enable();
currSpeed = pt1_calculate(&pt1, currSpeed);
......
......@@ -4,7 +4,7 @@ from pexpect import pxssh
from pygame.locals import *
ODROID_HOST_ADDRESS = "10.5.36.187"
ODROID_HOST_ADDRESS = "10.5.37.177"
class OdroidConnection(pxssh.pxssh):
......@@ -134,7 +134,7 @@ if __name__ == '__main__':
backwards = Button(
pygame.Rect(1 * (BUTTON_WIDTH + PADDING), 1 * (BUTTON_HEIGHT + PADDING), BUTTON_WIDTH, BUTTON_HEIGHT),
"BACKWARDS",
onPressed=lambda: conn.set_speed(-SPEED*4),
onPressed=lambda: conn.set_speed(ZERO_SPEED),
onReleased=lambda: conn.set_speed(ZERO_SPEED))
left = Button(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment