Ejemplo n.º 1
0
const char *AJAXHandler(int iIndex, int iNumParams, char *pcParam[], char *pcValue[]) {


	char *ptrState = getActuatorState(portNum_1);

	return ptrState;
}
Ejemplo n.º 2
0
/*
 * publishActuators()
 * write PWM values to PX4IO
 */
void
CStateMachine::publishActuators()
{
	EArmedState_t eState = getActuatorState();
	if(DISARMED == eState)
	{
		// arm system for output
		if(OK != setActuatorState(ARMED))
		{
			#if MAVLINK_VERBOSE > 1
			mavlink_and_console_log_info((void**)m_iMavLinkFd, "PARA: arming actuators \t[failed]\n");
			#endif
		}
		else
		{
			#if MAVLINK_VERBOSE > 1
			mavlink_and_console_log_info((void**)m_iMavLinkFd, "PARA: arming actuators \t[done]\n");
			#endif
		}
	}
	else
	{
		#if MAVLINK_VERBOSE > 1
		mavlink_and_console_log_info((void**)m_iMavLinkFd, "PARA: actuators already armed\n");
		#endif
	}

	orb_publish(ORB_ID(actuator_controls_3),
				m_actuatorsPub,
				&m_sUORBActuatorsControl);

	if(OK != setActuatorState(eState))
	{
		#if MAVLINK_VERBOSE > 1
		mavlink_and_console_log_info((void**)m_iMavLinkFd, "PARA: reset actuators arming state \t[failed]\n");
		#endif
	}
	else
	{
		#if MAVLINK_VERBOSE > 1
		mavlink_and_console_log_info((void**)m_iMavLinkFd, "PARA: reset actuators arming state \t[done]\n");
		#endif
	}
}