本文整理汇总了C++中aris::core::MSG类的典型用法代码示例。如果您正苦于以下问题:C++ MSG类的具体用法?C++ MSG怎么用?C++ MSG使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MSG类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: On_VS_DataReceived
int On_VS_DataReceived(Aris::Core::CONN *pConn, Aris::Core::MSG &data)
{
cout<<"receive data from visual system"<<endl;
double *map = new double [data.GetLength()/sizeof(double)];
memcpy(map, data.GetDataAddress(), data.GetLength() );
static double currentH[6],nextH[6];
memcpy(nextH,map,sizeof(nextH));
HexIII.MotionPlanWithKinect(currentH,nextH,*Gait_Calculated_From_Map);
memcpy(currentH,nextH,sizeof(nextH));
delete[] map;
for(int j=0;j<GAIT_ADAPTIVEWALK_LEN;j++)
{
for(int i=0;i<GAIT_WIDTH;i++)
{
CGait::GaitAdaptiveWalk[j][i]=-(int)(Gait_Calculated_From_Map[j][i]);
}
}
Aris::Core::MSG controldata;
controldata.SetMsgID(WALKADAPTIVE);
cs.NRT_PostMsg(controldata);
return 0;
}
示例2: if
Aris::Core::MSG parseSwing(const std::string &cmd, const map<std::string, std::string> ¶ms)
{
SWING_PARAM param;
for(auto &i:params)
{
if(i.first=="y")
{
param.centreP[1]=stod(i.second);
}
else if(i.first=="z")
{
param.centreP[2]=stod(i.second);
}
else if(i.first=="deg")
{
param.swingRad=stod(i.second)/180*PI;//计算身体摆动的弧度
}
else
{
std::cout<<"parse failed"<<std::endl;
return MSG{};
}
}
param.periodCount=3000;
Aris::Core::MSG msg;
msg.CopyStruct(param);
std::cout<<"finished parse"<<std::endl;
return msg;
}
示例3: On_VS_Connected
int On_VS_Connected(Aris::Core::MSG &msg)
{
cout<<"Received Connection from Vision System:"<<endl;
cout<<" Remote IP is: "<<msg.GetDataAddress()+sizeof(int)<<endl;
cout<<" Port is : "<<*((int*)msg.GetDataAddress()) << endl << endl;
return 0;
}
示例4: show
int show(const Aris::Core::MSG &msg)
{
cout << "Msg Length:" << msg.GetLength()<<endl;
cout << "Msg MsgID :" << msg.GetMsgID()<<endl;
//cout << "Msg Type :" << msg.GetType()<<endl;
cout << "Msg Data :" << msg.GetDataAddress()<<endl<<endl;
return 0;
}
示例5: autoTurnRight
int autoTurnRight(Aris::Core::MSG &msg)
{
EGAIT cmd=GAIT_TURN_RIGHT;
Aris::Core::MSG data;
data.SetLength(sizeof(cmd));
data.Copy(&cmd,sizeof(cmd));
cs.NRT_SendData(data);
return 0;
}
示例6: autoEndDiscover
int autoEndDiscover(Aris::Core::MSG &msg)
{
EGAIT cmd=GAIT_END_DISCOVER;
Aris::Core::MSG data;
data.SetLength(sizeof(cmd));
data.Copy(&cmd,sizeof(cmd));
cs.NRT_SendData(data);
return 0;
}
示例7: autoMoveBack
int autoMoveBack(Aris::Core::MSG &msg)
{
EGAIT cmd=GAIT_MOVE_BACK;
Aris::Core::MSG data;
data.SetLength(sizeof(cmd));
data.Copy(&cmd,sizeof(cmd));
cs.NRT_SendData(data);
return 0;
}
示例8: On_VS_ConnectionReceived
int On_VS_ConnectionReceived(Aris::Core::CONN *pConn, const char* addr,int port)
{
Aris::Core::MSG msg;
msg.SetMsgID(VS_Connected);
msg.SetLength(sizeof(port));
msg.Copy(&port,sizeof(port));
msg.CopyMore(addr,strlen(addr));
PostMsg(msg);
return 0;
}
示例9: On_CS_Connected
//MSG call back functions
int On_CS_Connected(Aris::Core::MSG &msg)
{
cout<<"Received Connection from Control System:"<<endl;
cout<<" Remote IP is: "<<msg.GetDataAddress()+sizeof(int)<<endl;
cout<<" Port is : "<<*((int*)msg.GetDataAddress()) << endl << endl;
Aris::Core::MSG data(0,0);
ControlSystem.SendData(data);
return 0;
}
示例10: On_CS_DataReceived
int On_CS_DataReceived(Aris::Core::CONN *pConn,Aris::Core::MSG &data)
{
int cmd=data.GetMsgID()+100;
Aris::Core::MSG CMD=CS_CMD_Received;
CMD.SetLength(sizeof(int));
bool IsCMDExecutable=true;
CMD.Copy(&cmd,sizeof(int));
cout<<"received CMD is"<<cmd<<endl;
PostMsg(CMD);
LastCMD=data.GetMsgID();
return 0;
}
示例11: autoStart
int autoStart(Aris::Core::MSG &msg)
{
EGAIT cmd=GAIT_HOME2START;
Aris::Core::MSG data;
data.SetLength(sizeof(cmd));
data.Copy(&cmd,sizeof(cmd));
cs.NRT_SendData(data);
return 0;
}
示例12:
int Aris::RT_CONTROL::ACTUATION::NRT_PostMsg(Aris::Core::MSG &p_data)
{
int ret;
//printf("sizeof %d\n",sizeof(p_data));
//p_data.SetMsgID((int)Aris::RT_CONTROL::CM_CUS_MESSAGE);
ret=sysBase->NRT_SendDataRaw(p_data._pData,p_data.GetLength()+MSG_HEADER_LENGTH);
//printf("NRT_SendData is me :%d\n",ret);
return 0;
}//ok
示例13: On_CS_DataReceived
int On_CS_DataReceived(Aris::Core::CONN *pConn, Aris::Core::MSG &data)
{
int cmd=data.GetMsgID();
MSG CMD=CS_CMD_Received;
CMD.SetLength(sizeof(int));
CMD.Copy(&cmd,sizeof(int));
cout<<"received CMD is "<<cmd<<endl;
PostMsg(CMD);
return 0;
}
示例14: On_CS_CMD_Received
int On_CS_CMD_Received(Aris::Core::MSG &msg)
{
int Command_Gait;
msg.Paste(&Command_Gait,sizeof(int));
Aris::Core::MSG Gait=Command_Gait;
cout<<"Gait Needed is: "<<Gait.GetMsgID()<<endl;
PostMsg(Gait);
Aris::Core::MSG data(0,0);
ControlSystem.SendData(data);
return 0;
}
示例15: On_CS_DataReceived
int On_CS_DataReceived(Aris::Core::CONN *pConn, Aris::Core::MSG &data)
{
int cmd_id=data.GetMsgID();
Aris::Core::MSG CMD;
CMD.SetMsgID(CS_CMD_Received);
CMD.SetLength(sizeof(int));
CMD.Copy(&cmd_id,sizeof(int));
// if the cmd has data, it should be repost together
CMD.CopyMore(data.GetDataAddress(), data.GetLength());
cout<<"received CMD is "<<cmd_id<<endl;
PostMsg(CMD);
return 0;
}