本文整理汇总了Java中com.MAVLink.Messages.MAVLinkMessage类的典型用法代码示例。如果您正苦于以下问题:Java MAVLinkMessage类的具体用法?Java MAVLinkMessage怎么用?Java MAVLinkMessage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MAVLinkMessage类属于com.MAVLink.Messages包,在下文中一共展示了MAVLinkMessage类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: sendToSource
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private void sendToSource(MAVLinkMessage msg) throws IOException, InterruptedException {
if (msg == null) {
return;
}
try {
MAVLinkPacket packet = msg.pack();
packet.sysid = msg.sysid;
packet.compid = 1;
src.sendMessage(packet);
MAVLinkLogger.log(Level.INFO, ">>", packet);
} catch (IOException ex) {
ex.printStackTrace();
onClose();
throw ex;
}
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:18,代码来源:ClientSession.java
示例2: notifyReceivedData
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
@Override
public void notifyReceivedData(MAVLinkPacket packet) {
MAVLinkMessage receivedMsg = packet.unpack();
this.mavLinkMsgHandler.receiveData(receivedMsg);
if (droneEventsListener != null) {
droneEventsListener.onReceivedMavLinkMessage(receivedMsg);
}
if (uploader != null)
try {
uploader.filterMavlink(uploader.interfaceNum, packet.encodePacket());
} catch (Exception e) {
Log.e(TAG, e.getMessage(), e);
}
}
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:17,代码来源:DroneManager.java
示例3: sendMavlinkMessage
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
@Override
public void sendMavlinkMessage(MavlinkMessageWrapper messageWrapper) throws RemoteException {
if(messageWrapper == null)
return;
MAVLinkMessage message = messageWrapper.getMavLinkMessage();
if(message == null)
return;
Drone drone = getDroneManager().getDrone();
if(drone == null)
return;
message.compid = drone.getCompid();
message.sysid = drone.getSysid();
drone.getMavClient().sendMavPacket(message.pack());
}
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:18,代码来源:DroneApi.java
示例4: onReceivedMavLinkMessage
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
@Override
public void onReceivedMavLinkMessage(MAVLinkMessage msg) {
if(mavlinkObserversList.isEmpty())
return;
if(msg != null){
final MavlinkMessageWrapper msgWrapper = new MavlinkMessageWrapper(msg);
for(IMavlinkObserver observer: mavlinkObserversList){
try {
observer.onMavlinkMessageReceived(msgWrapper);
} catch (RemoteException e) {
Log.e(TAG, e.getMessage(), e);
try{
removeMavlinkObserver(observer);
} catch (RemoteException e1) {
Log.e(TAG, e1.getMessage(), e1);
}
}
}
}
}
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:22,代码来源:DroneApi.java
示例5: run
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
@Override
public void run() {
try {
link.getUdpStream();
System.out.printf("Listening on udp:%s:%d%n", InetAddress.getLocalHost()
.getHostAddress(), link.localPort);
while (true) {
byte[] data = link.readDataBlock();
for (int i = 0; i < link.length; i++) {
MAVLinkPacket mavPacket = link.parser.mavlink_parse_char(data[i] & 0x00ff);
if (mavPacket != null) {
MAVLinkMessage msg = mavPacket.unpack();
mavlinkHandler.receiveData(msg);
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
System.out.println("Closing socket");
link.socket.close();
}
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:24,代码来源:Logic.java
示例6: getHeartbeatMsg
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private MAVLinkMessage getHeartbeatMsg(msg_high_latency msgHighLatency) {
msg_heartbeat msg = new msg_heartbeat();
msg.sysid = msgHighLatency.sysid;
msg.compid = msgHighLatency.compid;
msg.base_mode = msgHighLatency.base_mode;
msg.custom_mode = msgHighLatency.custom_mode;
msg.system_status = MAV_STATE.MAV_STATE_ACTIVE;
msg.autopilot = autopilot;
msg.type = mavType;
return msg;
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:12,代码来源:ClientSession.java
示例7: getSysStatusMsg
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private MAVLinkMessage getSysStatusMsg(msg_high_latency msgHighLatency) {
msg_sys_status msg = new msg_sys_status();
msg.sysid = msgHighLatency.sysid;
msg.compid = msgHighLatency.compid;
msg.battery_remaining = (byte)msgHighLatency.battery_remaining;
msg.current_battery = 0;
return msg;
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:9,代码来源:ClientSession.java
示例8: getGpsRawIntMsg
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private MAVLinkMessage getGpsRawIntMsg(msg_high_latency msgHighLatency) {
msg_gps_raw_int msg = new msg_gps_raw_int();
msg.sysid = msgHighLatency.sysid;
msg.compid = msgHighLatency.compid;
msg.fix_type = msgHighLatency.gps_fix_type;
msg.satellites_visible = msgHighLatency.gps_nsat;
msg.lat = msgHighLatency.latitude;
msg.lon = msgHighLatency.longitude;
msg.alt = msgHighLatency.altitude_amsl;
return msg;
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:12,代码来源:ClientSession.java
示例9: getAttitudeMsg
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private MAVLinkMessage getAttitudeMsg(msg_high_latency msgHighLatency) {
msg_attitude msg = new msg_attitude();
msg.sysid = msgHighLatency.sysid;
msg.compid = msgHighLatency.compid;
msg.yaw = (float)Math.toRadians(msgHighLatency.heading / 100.0);
msg.pitch = (float)Math.toRadians(msgHighLatency.pitch / 100.0);
msg.roll = (float)Math.toRadians(msgHighLatency.roll / 100.0);
return msg;
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:10,代码来源:ClientSession.java
示例10: getGlobalPositionIntMsg
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private MAVLinkMessage getGlobalPositionIntMsg(msg_high_latency msgHighLatency) {
msg_global_position_int msg = new msg_global_position_int();
msg.sysid = msgHighLatency.sysid;
msg.compid = msgHighLatency.compid;
msg.alt = msgHighLatency.altitude_amsl;
msg.lat = msgHighLatency.latitude;
msg.lon = msgHighLatency.longitude;
msg.hdg = msgHighLatency.heading;
msg.relative_alt = msgHighLatency.altitude_sp;
return msg;
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:12,代码来源:ClientSession.java
示例11: getMissionCurrentMsg
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private MAVLinkMessage getMissionCurrentMsg(msg_high_latency msgHighLatency) {
msg_mission_current msg = new msg_mission_current();
msg.sysid = msgHighLatency.sysid;
msg.compid = msgHighLatency.compid;
msg.seq = msgHighLatency.wp_num;
return msg;
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:8,代码来源:ClientSession.java
示例12: getNavControllerOutputMsg
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private MAVLinkMessage getNavControllerOutputMsg(msg_high_latency msgHighLatency) {
msg_nav_controller_output msg = new msg_nav_controller_output();
msg.sysid = msgHighLatency.sysid;
msg.compid = msgHighLatency.compid;
msg.nav_bearing = (short)(msgHighLatency.heading_sp / 100);
return msg;
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:8,代码来源:ClientSession.java
示例13: getVfrHudMsg
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private MAVLinkMessage getVfrHudMsg(msg_high_latency msgHighLatency) {
msg_vfr_hud msg = new msg_vfr_hud();
msg.sysid = msgHighLatency.sysid;
msg.compid = msgHighLatency.compid;
msg.airspeed = msgHighLatency.airspeed;
msg.alt = msgHighLatency.altitude_amsl;
msg.climb = msgHighLatency.climb_rate;
msg.groundspeed = msgHighLatency.groundspeed;
msg.heading = (short)(msgHighLatency.heading / 100);
msg.throttle = msgHighLatency.throttle;
return msg;
}
开发者ID:envirover,项目名称:SPLGroundControl,代码行数:13,代码来源:ClientSession.java
示例14: processMessage
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
/**
* Try to process a Mavlink message if it is a parameter related message
*
* @param msg
* Mavlink message to process
* @return Returns true if the message has been processed
*/
public boolean processMessage(MAVLinkMessage msg) {
if (msg.msgid == msg_param_value.MAVLINK_MSG_ID_PARAM_VALUE) {
processReceivedParam((msg_param_value) msg);
return true;
}
return false;
}
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:15,代码来源:Parameters.java
示例15: processMessage
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
public void processMessage(MAVLinkMessage msg) {
if (msg.msgid == msg_statustext.MAVLINK_MSG_ID_STATUSTEXT) {
msg_statustext statusMsg = (msg_statustext) msg;
mavMsg = statusMsg.getText();
if (mavMsg.contains("Calibration"))
calibrating = false;
myDrone.notifyDroneEvent(DroneEventsType.CALIBRATION_IMU);
}
}
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:12,代码来源:Calibration.java
示例16: handleData
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private void handleData(Parser parser, int bufferSize, byte[] buffer) {
if (bufferSize < 1) {
return;
}
for (int i = 0; i < bufferSize; i++) {
MAVLinkPacket receivedPacket = parser.mavlink_parse_char(buffer[i] & 0x00ff);
if (receivedPacket != null) {
MAVLinkMessage msg = receivedPacket.unpack();
reportReceivedMessage(msg);
queueToLog(receivedPacket);
}
}
}
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:15,代码来源:MavLinkConnection.java
示例17: reportReceivedMessage
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
/**
* Utility method to notify the mavlink listeners about received messages.
*
* @param msg
* received mavlink message
*/
private void reportReceivedMessage(MAVLinkMessage msg) {
if (mListeners.isEmpty())
return;
for (MavLinkConnectionListener listener : mListeners.values()) {
listener.onReceiveMessage(msg);
}
}
开发者ID:ne0fhyk,项目名称:3DRServices,代码行数:15,代码来源:MavLinkConnection.java
示例18: handleData
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
private void handleData() throws IOException {
if (iavailable < 1) {
return;
}
for (i = 0; i < iavailable; i++) {
receivedPacket = parser.mavlink_parse_char(readData[i] & 0x00ff);
if (receivedPacket != null) {
saveToLog(receivedPacket);
MAVLinkMessage msg = receivedPacket.unpack();
listener.onReceiveMessage(msg);
}
}
}
开发者ID:neonbjb,项目名称:MavInterfaceLib,代码行数:14,代码来源:MAVLinkConnection.java
示例19: handleMAVLink_Message
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
@Override
public void handleMAVLink_Message(MAVLinkMessage m) {
// TODO Auto-generated method stub
}
开发者ID:AndriiDSD,项目名称:GND_Control,代码行数:6,代码来源:GND_Vehicle.java
示例20: Event
import com.MAVLink.Messages.MAVLinkMessage; //导入依赖的package包/类
public Event(long timestamp, MAVLinkMessage mavLinkMessage) {
this.timestamp = timestamp;
this.mavLinkMessage = mavLinkMessage;
}
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:5,代码来源:TLogReader.java
注:本文中的com.MAVLink.Messages.MAVLinkMessage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论