sea-bass / pyrobosim

ROS 2 enabled 2D mobile robot simulator for behavior prototyping.
https://pyrobosim.readthedocs.io/
MIT License
248 stars 40 forks source link

Allow specifying poses as YAML in world files #295

Closed sea-bass closed 3 weeks ago

sea-bass commented 3 weeks ago

This PR allows YAML specifications of poses, such as

pose:
  position:
    x: 1.0
    y: 2.0
  rotation_eul:
    yaw: 1.57

or

pose:
  position:
    x: 1.0
    y: 2.0
  rotation_quat:
    w: 0.7071
    x: 0.0
    y: 0.0
    z: -0.7071

This is intended to be the default specification going forward, but keeping the old one for backward compatibility.

It also adds a to_dict() method for poses, which will be instrumental to serializing worlds to YAML in follow-on PRs.

github-actions[bot] commented 3 weeks ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py00100% 
core
   __init__.py90100% 
   dynamics.py49197%142
   gazebo.py137894%55, 128, 234, 248–252
   hallway.py94891%200, 242–245, 269–271
   locations.py1311886%69, 71, 88, 104, 117–118, 120–121, 138, 196, 211, 236, 246, 302–303, 305–306, 335
   objects.py69592%78, 106, 137, 184, 197
   robot.py4808482%268, 271, 283, 286, 290–291, 296–297, 337–339, 355, 372–373, 412–414, 418–422, 447, 450, 454–456, 483, 485, 527–528, 530–531, 537–538, 547–550, 555, 557, 566–568, 575–577, 639–641, 666–668, 674–675, 683–687, 732–734, 745–746, 806–808, 813, 860–862, 867, 885, 891, 894, 896, 898, 901–903, 980, 998, 1001
   room.py48197%113
   world.py82019076%160, 163, 197–198, 202, 274–275, 277, 280, 310–311, 373, 387–388, 390, 393, 408–410, 430–434, 436–438, 440–441, 444, 446–449, 453–457, 460–461, 464, 467–478, 494–495, 513–515, 529, 531, 534–535, 540–542, 561–562, 564–565, 581, 583, 586–587, 592–594, 604–606, 623–624, 626–627, 641, 643, 646–647, 652–654, 677, 679, 682–683, 688–690, 726, 732, 768–769, 772, 795, 815, 818, 829, 832, 840, 856–860, 862, 865–866, 869–872, 874, 877, 880–881, 884–886, 888–890, 892–894, 896, 911, 918, 929–933, 968–969, 973–974, 992–993, 999–1000, 1002–1003, 1005, 1007–1008, 1010, 1012–1013, 1023–1024, 1027, 1029, 1043, 1045, 1052, 1099, 1130–1131, 1154–1155, 1159–1160, 1179–1180, 1184–1185, 1210–1211, 1264–1265, 1289, 1354, 1361, 1471–1472, 1524, 1604–1605, 1671, 1681
   yaml_utils.py109694%62, 66, 165, 168, 187, 190
gui
   __init__.py20100% 
   action_runners.py914847%32–33, 35–39, 41, 74–75, 77–81, 83, 109–110, 112–116, 118, 144–145, 147–151, 153, 176–177, 179–183, 185, 208–209, 211–215, 217
   main.py2747273%23–25, 46, 90, 94–97, 246–255, 267–276, 279, 286–289, 291, 294–300, 304, 309–310, 314–315, 326, 369–370, 379–380, 384–385, 397, 400–403, 405–406, 409–412, 414–416, 420–423
   world_canvas.py2635280%134–137, 141–142, 147–148, 155, 157, 159, 216–218, 224, 226, 246–248, 293, 350–351, 378–379, 381, 383–384, 386–389, 391–392, 396–402, 405, 408–409, 422, 440–441, 443, 449, 451–454
manipulation
   __init__.py10100% 
   grasping.py2376473%100, 108, 110–112, 114–122, 124, 132, 462, 464–466, 470–472, 566–567, 569–571, 574–578, 586, 589–591, 596–597, 603–607, 610–617, 620–622, 631, 633, 635–641
navigation
   __init__.py11190%37
   a_star.py761185%82–84, 87–89, 91–93, 181, 190
   execution.py94792%81–83, 88–90, 125
   occupancy_grid.py1391489%45–48, 50–54, 57, 193, 227, 235, 239
   prm.py55492%59–60, 139, 148
   rrt.py1600100% 
   visualization.py32681%88–93
   world_graph.py58493%117, 120, 130, 139
planning
   __init__.py00100% 
   actions.py1120100% 
planning/pddlstream
   __init__.py7185%13
   defaultmappings.py90100% 
   planner.py40880%119–126
   primitives.py61493%68, 82, 94, 232
   utils.py99891%66, 93, 105, 115–116, 207–208, 211
utils
   __init_\.py00100% 
   general.py33487%23, 45, 51–52
   knowledge.py1522086%91, 122, 163–168, 170–171, 174–178, 209–210, 252, 268, 331
   logging.py15193%55
   motion.py70395%93–94, 96
   polygon.py1110100% 
   pose.py1110100% 
   search_graph.py93396%239–241
   trajectory.py67297%130, 167
TOTAL441965885% 

Tests Skipped Failures Errors Time
197 0 :zzz: 0 :x: 0 :fire: 3m 23s :stopwatch: