This document introduces the demo project of "go_home_charge", including how to call the goHome() API to have the robot go back to charge.


IDE Preperation

  • Software

    • Visual Studio 2010  SP1
    • Slamware Windows SDK:Slamware Windows SDK
    • RoboStudio(for map display):Robostudio installer 
    • Sample Code: 

      Higher version of Visual Studio will cause errors. Sometime you will need to upgrade SP1 package to make your VS compatable with .Net Framework.
  • Hardware

          (Either one of following)

    • Slamware SDP mini 
    • Slamware SDP
    • Slamware Kit 
    • Zeus/Apollo robot base




  1. Right click on "go_home_to_charge" project, set as StartUp project.

  2. Right click on "go_home_to_charge", then " Properties",configure "include" and "lib" directories to the corresponding folder path of Slamware SDK.

    It's not necessary to copy files to the project directory, user will only need to configure the path of SDK.

  3. Right click on "go_home_to_charge", then "properties",set "Command Arguments" as follows:
    Syntax :go_home_to_charge <IP address>>

  4. Click " F5" to execute.
  5. Robot's motion could be seen in Robostudio.


  • Call the goHome () API to have the robot go back to charge. If it doesn't find the charger or fail to charge, you could consider calling this API again.

    In general, the charging docking failure can only be determined when the docking still fails after three calls to goHome(). During the three attempts, if there is any docking completed, the docking success can still be determined.

    Go back to charge
            const int max_go_home_times = 3;     	
            SlamwareCorePlatform sdp = SlamwareCorePlatform::connect(argv[1], 1445);
            std::cout <<"SDK Version: " << sdp.getSDKVersion() << std::endl;
            std::cout <<"SDP Version: " << sdp.getSDPVersion() << std::endl;
    		int go_home_count = 1;
    		rpos::actions::MoveAction action;
    		do {
    			action = sdp.goHome();
    			if(action.getStatus() == rpos::core::ActionStatusFinished)
    			std::cout << "go home to charge times count: "  << go_home_count << std::endl;
    		while(go_home_count <= max_go_home_times);
  • No labels