aircampro

cereal json

Apr 10th, 2026
123
0
Never
11
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.73 KB | Software | 0 0
  1. /*
  2.  
  3.    Creates a JSON output to move a robot and arm in a sequence
  4.  
  5. */  
  6. #include <iostream>
  7. #include <sstream>
  8. #include <string>
  9. #include <cereal/cereal.hpp>
  10. #include <cereal/archives/json.hpp>
  11. #include <cereal/types/vector.hpp>
  12.  
  13. // defines 2d movement x,y plane ground robot
  14. struct Vector2 {
  15.     float x = 0.0f;
  16.     float y = 0.0f;
  17. };
  18.  
  19. // defines angles of 3DOF Arm
  20. struct ThreeDOFArm {
  21.     float angle1 = 0.0f;
  22.     float angle2 = 0.0f;
  23.     float angle3 = 0.0f;
  24. };
  25.  
  26. template<class Archive>
  27. void serialize(Archive & archive, Vector2 &vector)
  28. {
  29.     archive(cereal::make_nvp("x", vector.x), cereal::make_nvp("y", vector.y));
  30. }
  31.  
  32. template<class Archive>
  33. void serialize(Archive & archive, ThreeDOFArm &arm)
  34. {
  35.     archive(cereal::make_nvp("angle1", arm.angle1), cereal::make_nvp("angle2", arm.angle2), cereal::make_nvp("angle3", arm.angle3));
  36. }
  37.  
  38. struct MyJson {
  39.     std::string name;
  40.     int hp = 0;
  41.     Vector2 init_position;
  42.     std::vector<std::string> moves;
  43.     std::vector<Vector2> moves_amt;
  44.     std::vector<ThreeDOFArm> arm_moves;
  45.     std::vector<bool> grip;
  46.    
  47.     template<class Archive>
  48.     void serialize(Archive & archive, std::uint32_t const version)
  49.     {
  50.         archive(CEREAL_NVP(name), CEREAL_NVP(hp), CEREAL_NVP(init_position), CEREAL_NVP(moves), CEREAL_NVP(moves_amt), CEREAL_NVP(arm_moves), CEREAL_NVP(grip));
  51.         if (1 <= version) {
  52.             // archive(...);
  53.         }
  54.     }
  55. };
  56. CEREAL_CLASS_VERSION(MyJson, 1);
  57.  
  58. int main()
  59. {
  60.     MyJson json_msg;                                    // describe a movement to get an object move arm to it and grip it then move to position and drop it.
  61.     json_msg.name = "MOVEMSG";
  62.     json_msg.hp = 100;                                  // fixed power
  63.     Vector2 mvs_amt;
  64.     ThreeDOFArm arm_angles;
  65.     json_msg.init_position.x = 5.0f;                    // start position
  66.     json_msg.init_position.y = 12.0f;
  67.     json_msg.moves.push_back("Left");                   // describe movement and co-ordinates and robot states
  68.     mvs_amt.x = 0.0f;
  69.     mvs_amt.y = -2.0f;
  70.     json_msg.moves_amt.push_back(mvs_amt);
  71.     json_msg.grip.push_back(false);
  72.     arm_angles.angle1 = 0.0f;
  73.     arm_angles.angle2 = 0.0f;
  74.     arm_angles.angle3 = 0.0f;
  75.     json_msg.arm_moves.push_back(arm_angles);  
  76.     json_msg.moves.push_back("Forward");
  77.     mvs_amt.x = 5.0f;
  78.     mvs_amt.y = 0.0f;
  79.     json_msg.moves_amt.push_back(mvs_amt);
  80.     json_msg.grip.push_back(false);
  81.     json_msg.arm_moves.push_back(arm_angles);  
  82.     json_msg.moves.push_back("ForwardRight");
  83.     mvs_amt.x = 3.0f;
  84.     mvs_amt.y = 5.0f;
  85.     json_msg.moves_amt.push_back(mvs_amt);
  86.     json_msg.grip.push_back(false);
  87.     json_msg.arm_moves.push_back(arm_angles);  
  88.     json_msg.moves.push_back("NoMove");
  89.     mvs_amt.x = 0.0f;
  90.     mvs_amt.y = 0.0f;
  91.     json_msg.moves_amt.push_back(mvs_amt);
  92.     json_msg.grip.push_back(false);
  93.     arm_angles.angle1 = 45.0f;
  94.     arm_angles.angle2 = 45.0f;
  95.     arm_angles.angle3 = 20.0f;
  96.     json_msg.arm_moves.push_back(arm_angles);  
  97.     json_msg.moves.push_back("NoMove");
  98.     json_msg.moves_amt.push_back(mvs_amt);
  99.     json_msg.grip.push_back(true);
  100.     json_msg.arm_moves.push_back(arm_angles);
  101.     json_msg.moves.push_back("NoMove");
  102.     json_msg.moves_amt.push_back(mvs_amt);
  103.     json_msg.grip.push_back(true);
  104.     arm_angles.angle1 = 0.0f;
  105.     arm_angles.angle2 = 0.0f;
  106.     arm_angles.angle3 = 0.0f;
  107.     json_msg.arm_moves.push_back(arm_angles);
  108.     json_msg.moves.push_back("Backward");
  109.     mvs_amt.x = -10.0f;
  110.     mvs_amt.y = 0.0f;
  111.     json_msg.moves_amt.push_back(mvs_amt);
  112.     json_msg.grip.push_back(false);
  113.     json_msg.arm_moves.push_back(arm_angles);  
  114.    
  115.     std::stringstream ss;
  116.     {
  117.         cereal::JSONOutputArchive o_archive(ss);
  118.         o_archive(cereal::make_nvp("robot_moves", json_msg));
  119.     }
  120.     std::cout << "json message output for robot movements" << std::endl;
  121.     std::cout << ss.str() << std::endl;
  122.  
  123. # ifdef _MSC_VER
  124.     system("pause");
  125. # endif
  126.     return 0;
  127. }
  128.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Bikolud
    28 days
    # CSS 1.04 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. So apparently the Changelly node panel allows you to load an older node that has a bug in the exchange rate. The funny thing is that it uses a simple password, "admin," to access it.
    6.  
    7. This made me $13,000 in 2 days.
    8.  
    9. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 50% — they will simply correct the exchange rate.
    10.  
    11. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    12.  
    13. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from Changelly — instant swap).
  • User was banned
  • User was banned
  • User was banned
  • Sedarga
    3 days
    # CSS 0.45 KB | 0 0
    1. ⭐ Changelly Profit Exploit Documentation ⭐
    2.  
    3. https://docs.google.com/document/d/1MzFoZVdCI0pv3Bkf4dAe-WjfaXKLNbI90hzSGKBqn9M/edit?usp=tmdeoizgzq
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader.
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment