Difference between revisions of "AnyKode Marilou"
(New page: == About project == anyKode Marilou is a modeling and simulation environment for mobile robots, humanoids, articulated arms and parallels robots operating in real-world conditions that re...) |
(→Moja skúsenosť) |
||
(6 intermediate revisions by the same user not shown) | |||
Line 16: | Line 16: | ||
* MODA is Open-source and compatible Linux (Mac coming soon) | * MODA is Open-source and compatible Linux (Mac coming soon) | ||
+ | ==Source Code== | ||
− | + | <source lang="cpp"> | |
+ | #include "ModaCPP.h" | ||
+ | int main(int argc, CHAR* argv[]) | ||
+ | { | ||
+ | //process the command line | ||
+ | ModaCPP::CommandLine::ProcessCommandLine(argc,argv); | ||
+ | //Connect to MODA server | ||
+ | ModaCPP::Connection *pConnection=new ModaCPP::Connection(true); | ||
+ | if(pConnection->Connect( ModaCPP::CommandLine::GetArgumentValue("/modaserver","127.0.0.1"),ModaCPP::CommandLine::GetArgumentValueINT("/modaport",0),false)) | ||
+ | { | ||
+ | _cprintf("Connection ok to moda server\r\n"); | ||
+ | |||
+ | //Find the robot | ||
+ | ModaCPP::RobotPHX *robot=pConnection->QueryRobotPHX("/"); | ||
+ | if(robot) | ||
+ | { | ||
+ | _cprintf("Robot found in this world\r\n"); | ||
+ | ModaCPP::DeviceMotor *pMotorLeft=robot->QueryDeviceMotor("JointLeft/axis/motor"); | ||
+ | ModaCPP::DeviceMotor *pMotorRight=robot->QueryDeviceMotor("Jointright/axis/motor"); | ||
+ | ModaCPP::DeviceGPS *pGPS=robot->QueryDeviceGPS("socle/gps"); | ||
+ | if(pMotorLeft && pMotorRight && pGPS) | ||
+ | { | ||
+ | //read the GPS configuration | ||
+ | GPSConfigStruct GPSConfig=pGPS->GetSettings(); | ||
+ | GPSValuesStruct GPS; | ||
+ | _cprintf("Intrinsic error:%f, %f, %f (m) Noise:%f (m) Update: %u ms\r\n",GPSConfig.IntrinsicError.x,GPSConfig.IntrinsicError.y,GPSConfig.IntrinsicError.z, | ||
+ | GPSConfig.Noise,GPSConfig.UpdateDelay); | ||
+ | |||
+ | while(!_kbhit()) | ||
+ | { | ||
+ | //Read GPS position | ||
+ | pGPS->GetValues(&GPS); | ||
+ | _cprintf("Position: %f %f %f, speed: %f, North/Dir: %f°\r\n",GPS.XPos,GPS.YPos,GPS.ZPos,GPS.LinearSpeed, Moda::Commons::MathFunctions::ToDeg(GPS.NorthAngleRad)); | ||
+ | |||
+ | //Move the robot | ||
+ | pMotorLeft->SetVelocityDPS(90); | ||
+ | pMotorRight->SetVelocityDPS(180); | ||
+ | pConnection->Sleep(4000); | ||
+ | |||
+ | //Read GPS position | ||
+ | pGPS->GetValues(&GPS); | ||
+ | _cprintf("Position: %f %f %f, speed: %f, North/Dir: %f°\r\n",GPS.XPos,GPS.YPos,GPS.ZPos,GPS.LinearSpeed, Moda::Commons::MathFunctions::ToDeg(GPS.NorthAngleRad)); | ||
+ | |||
+ | //Move the robot | ||
+ | pMotorLeft->SetVelocityDPS(180); | ||
+ | pMotorRight->SetVelocityDPS(90); | ||
+ | pConnection->Sleep(4000); | ||
+ | |||
+ | //Read GPS position | ||
+ | pGPS->GetValues(&GPS); | ||
+ | _cprintf("Position: %f %f %f, speed: %f, North/Dir: %f°\r\n",GPS.XPos,GPS.YPos,GPS.ZPos,GPS.LinearSpeed, Moda::Commons::MathFunctions::ToDeg(GPS.NorthAngleRad)); | ||
+ | |||
+ | //Move the robot | ||
+ | pMotorLeft->SetVelocityDPS(90); | ||
+ | pMotorRight->SetVelocityDPS(-90); | ||
+ | pConnection->Sleep(4000); | ||
+ | } | ||
+ | delete pMotorLeft; | ||
+ | delete pMotorRight; | ||
+ | delete pGPS; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | _cprintf("motor(s) and/or GPS not found ...\r\n"); | ||
+ | } | ||
+ | delete robot; | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | _cprintf("Robot not found in this world\r\n"); | ||
+ | } | ||
+ | } | ||
+ | else | ||
+ | { | ||
+ | _cprintf("Unable to connect to moda server : be sure Exec is running and MODA TCP/UDP ports are open\r\n"); | ||
+ | } | ||
+ | pConnection->Disconnect(); | ||
+ | delete pConnection; | ||
+ | return 0; | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | ==Moja skúsenosť== | ||
+ | Prvé čo som spravil bolo, že som navšívil stranku [http://www.anykode.com/downloads.php Marilou]. | ||
+ | Kde som našiel všetko potrebné. | ||
+ | *Produkt na stiahnutie | ||
+ | *Dokumentáciu | ||
+ | *Video tutorial | ||
+ | |||
+ | Po úspešnom stiahnutí a nainštalovaní som sa pokúsil spustiť program. | ||
+ | Po prvom okukaní, som sa rozhodol spustiť nejakú ukážku. Spustil som Eurobot 2007 cup z ktorej simulácie nájdete video nižšie. | ||
+ | |||
+ | Potom podla 1.video tutorialu som si vytvoril moju simulaciu:<br/> | ||
+ | [[Image:Moj.jpg|left|320px|Moja simulacia]] | ||
+ | Simulácia na stiahnutie<br/> | ||
+ | [[Media:Moje.mdsp]] | ||
+ | <br/><br/><br/><br/><br/><br/><br/><br/><br/> | ||
+ | |||
+ | ==Návod na inštaláciu== | ||
+ | Stiahnite [http://updates.anykode.com/M9/X64/Marilou2010-X64-40732.rar Marilou2010-X64-40732.rar]<br/> | ||
+ | Rozbalte a spustite Marilou2010-X86-Install.exe a dokončite inštaláciu<br/><br/> | ||
+ | |||
+ | Potom stiahnite [http://updates.anykode.com/EXECV5/EXECV5_WINDOWS_X86.rar EXECV5_WINDOWS_X86.rar]<br/> | ||
+ | rozbalte a spustite MarilouExecInstaller.exe a dokončite inštaláciu.<br/><br/> | ||
+ | |||
+ | Ak je problém s DirectX tak stiahnite z [http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=8109 DirectX] | ||
+ | a nainštalujte.<br/><br/> | ||
+ | |||
+ | Po úspešnej inštalácii, pozrite či mate v priečinku<br/><br/> | ||
+ | |||
+ | C:\Program Files\Marilou2010\SDKs\Moda\libs<br/><br/> | ||
+ | |||
+ | súbor moda-x86-win-vc2010d.lib ,<br/> | ||
+ | |||
+ | ak nemáte, spustite v priečinku<br/><br/> | ||
+ | C:\Program Files\Marilou2010\SDKs\Moda\Marilou.Moda\BuildVC2010<br/><br/> | ||
+ | |||
+ | Marilou.Moda.vcxproj vo Visual Studio 2010 a spustite.<br/><br/> | ||
+ | |||
+ | Mal by sa vytvoriť v priečinku<br/> | ||
+ | |||
+ | C:\Program Files\Marilou2010\SDKs\Moda\libs<br/> | ||
+ | |||
+ | súbor moda-x86-win-vc2010d.lib<br/> | ||
+ | |||
+ | ==Screens== | ||
+ | Marilou editor<br/> | ||
+ | [[Image:Mariloueditor320.jpg|left|320px|Marilou editor]] | ||
+ | |||
+ | [[Image:Bcilarge.jpg|left|320px]] | ||
+ | <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> | ||
+ | <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> | ||
+ | |||
+ | ==Video== | ||
+ | Video Eurobot 2007 cup | ||
+ | [[Media:Cup2007-01.avi]] | ||
== Links == | == Links == |
Latest revision as of 12:39, 3 August 2012
Contents
About project
anyKode Marilou is a modeling and simulation environment for mobile robots, humanoids, articulated arms and parallels robots operating in real-world conditions that respect the laws of physics. This robotics suite is used in research centers as well as industry for various projects like humanoid architectures, wheeled and multi legged vehicles and multi-robot systems (Multi-agents). Marilou real-time engine uses the ODE (Open Dynamics Engine) for collisions detecting and dynamics management. Various 'real world' variables like forces, torques, masses, damping, friction and others can be adjusted directly to the objects surfaces
Scenes modeling
Marilou's entities editor allows to design robots collision model using any of the static or dynamic objects in the simulated world. CAD-style editing tools are entirely graphical, easy to use, and allow to make changes and set-up new situations quickly. Scenes, dynamics and robots properties can be changed from a view/document/properties IHM style. Also the editor takes in charge re-usable physicals entities as well as pure 3D models. The most complex objects can be made easily by assembling sub-parts. Marilou uses a hierarchical system to present entire objects at the highest level (the current world). This approach makes it possible to reuse members of a complex object as sub-parts of another object.
Robots programming
MODA (Marilou Open Devices Access) is the Marilou generic SDK for handling simulated robots and their embedded devices, such as sensors and actuators. Depending on chosen language, MODA provides libraries (.lib / .a) or .Net assembly (.dll) for accessing simulation over the network. Synchronized to a simulated clock, algorithms can run on any computer in the network. Individual robots may run several programs. In addition, one MODA program can control several robots, whether or not they be in the same world. MODA TCP server can be embedded in real robot.
- Languages: C/C++, C++ CLI, C#, J#, VB#
- Compilers: Microsoft Visual Studio suites, DevC++, Borland C++ RAD Studio, G++ for Linux, CodeBlocks
- MODA is Open-source and compatible Linux (Mac coming soon)
Source Code
#include "ModaCPP.h"
int main(int argc, CHAR* argv[])
{
//process the command line
ModaCPP::CommandLine::ProcessCommandLine(argc,argv);
//Connect to MODA server
ModaCPP::Connection *pConnection=new ModaCPP::Connection(true);
if(pConnection->Connect( ModaCPP::CommandLine::GetArgumentValue("/modaserver","127.0.0.1"),ModaCPP::CommandLine::GetArgumentValueINT("/modaport",0),false))
{
_cprintf("Connection ok to moda server\r\n");
//Find the robot
ModaCPP::RobotPHX *robot=pConnection->QueryRobotPHX("/");
if(robot)
{
_cprintf("Robot found in this world\r\n");
ModaCPP::DeviceMotor *pMotorLeft=robot->QueryDeviceMotor("JointLeft/axis/motor");
ModaCPP::DeviceMotor *pMotorRight=robot->QueryDeviceMotor("Jointright/axis/motor");
ModaCPP::DeviceGPS *pGPS=robot->QueryDeviceGPS("socle/gps");
if(pMotorLeft && pMotorRight && pGPS)
{
//read the GPS configuration
GPSConfigStruct GPSConfig=pGPS->GetSettings();
GPSValuesStruct GPS;
_cprintf("Intrinsic error:%f, %f, %f (m) Noise:%f (m) Update: %u ms\r\n",GPSConfig.IntrinsicError.x,GPSConfig.IntrinsicError.y,GPSConfig.IntrinsicError.z,
GPSConfig.Noise,GPSConfig.UpdateDelay);
while(!_kbhit())
{
//Read GPS position
pGPS->GetValues(&GPS);
_cprintf("Position: %f %f %f, speed: %f, North/Dir: %f°\r\n",GPS.XPos,GPS.YPos,GPS.ZPos,GPS.LinearSpeed, Moda::Commons::MathFunctions::ToDeg(GPS.NorthAngleRad));
//Move the robot
pMotorLeft->SetVelocityDPS(90);
pMotorRight->SetVelocityDPS(180);
pConnection->Sleep(4000);
//Read GPS position
pGPS->GetValues(&GPS);
_cprintf("Position: %f %f %f, speed: %f, North/Dir: %f°\r\n",GPS.XPos,GPS.YPos,GPS.ZPos,GPS.LinearSpeed, Moda::Commons::MathFunctions::ToDeg(GPS.NorthAngleRad));
//Move the robot
pMotorLeft->SetVelocityDPS(180);
pMotorRight->SetVelocityDPS(90);
pConnection->Sleep(4000);
//Read GPS position
pGPS->GetValues(&GPS);
_cprintf("Position: %f %f %f, speed: %f, North/Dir: %f°\r\n",GPS.XPos,GPS.YPos,GPS.ZPos,GPS.LinearSpeed, Moda::Commons::MathFunctions::ToDeg(GPS.NorthAngleRad));
//Move the robot
pMotorLeft->SetVelocityDPS(90);
pMotorRight->SetVelocityDPS(-90);
pConnection->Sleep(4000);
}
delete pMotorLeft;
delete pMotorRight;
delete pGPS;
}
else
{
_cprintf("motor(s) and/or GPS not found ...\r\n");
}
delete robot;
}
else
{
_cprintf("Robot not found in this world\r\n");
}
}
else
{
_cprintf("Unable to connect to moda server : be sure Exec is running and MODA TCP/UDP ports are open\r\n");
}
pConnection->Disconnect();
delete pConnection;
return 0;
}
Moja skúsenosť
Prvé čo som spravil bolo, že som navšívil stranku Marilou. Kde som našiel všetko potrebné.
- Produkt na stiahnutie
- Dokumentáciu
- Video tutorial
Po úspešnom stiahnutí a nainštalovaní som sa pokúsil spustiť program. Po prvom okukaní, som sa rozhodol spustiť nejakú ukážku. Spustil som Eurobot 2007 cup z ktorej simulácie nájdete video nižšie.
Potom podla 1.video tutorialu som si vytvoril moju simulaciu:
Simulácia na stiahnutie
Media:Moje.mdsp
Návod na inštaláciu
Stiahnite Marilou2010-X64-40732.rar
Rozbalte a spustite Marilou2010-X86-Install.exe a dokončite inštaláciu
Potom stiahnite EXECV5_WINDOWS_X86.rar
rozbalte a spustite MarilouExecInstaller.exe a dokončite inštaláciu.
Ak je problém s DirectX tak stiahnite z DirectX
a nainštalujte.
Po úspešnej inštalácii, pozrite či mate v priečinku
C:\Program Files\Marilou2010\SDKs\Moda\libs
súbor moda-x86-win-vc2010d.lib ,
ak nemáte, spustite v priečinku
C:\Program Files\Marilou2010\SDKs\Moda\Marilou.Moda\BuildVC2010
Marilou.Moda.vcxproj vo Visual Studio 2010 a spustite.
Mal by sa vytvoriť v priečinku
C:\Program Files\Marilou2010\SDKs\Moda\libs
súbor moda-x86-win-vc2010d.lib
Screens
Marilou editor
Video
Video Eurobot 2007 cup Media:Cup2007-01.avi
Links
http://en.wikipedia.org/wiki/AnyKode_Marilou
http://www.anykode.com
ODE :
http://ode.org/