Repository: stephane-caron/vulp (language: python)

Issue:
[feature] parameter to add extra URDFs
This PR introduces a new parameter (i.e. a vector of strings) that can be used to specify additional URDFs to be loaded into simulation at launch time.

Closes #80.


Discussion / hints:
## Pull Request Test Coverage Report for [Build 7726630738](https://coveralls.io/builds/65409510)


* **-4** of **5**   **(20.0%)**  changed or added relevant lines in **1** file are covered.
* No unchanged relevant lines lost coverage.
* Overall coverage decreased (**-0.2%**) to **89.431%**

---

|  Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
| :-----|--------------|--------|---: |
| [vulp/actuation/BulletInterface.cpp](https://coveralls.io/builds/65409510/source?filename=vulp%2Factuation%2FBulletInterface.cpp#L83) | 1 | 5 | 20.0%
<!-- | **Total:** | **1** | **5** | **20.0%** | -->


|  Totals | [![Coverage Status](https://coveralls.io/builds/65409510/badge)](https://coveralls.io/builds/65409510) |
| :-- | --: |
| Change from base [Build 7608961794](https://coveralls.io/builds/65208122): |  -0.2% |
| Covered Lines: | 1760 |
| Relevant Lines: | 1968 |

---
##### 💛  - [Coveralls](https://coveralls.io)

LGTM :+1:

If you feel so inclined you can also blast loading a ground plane URDF (removing the dependency on `bazel::tools::cpp::runfiles::Runfiles`) and pass the ground as an extra URDF in the Upkie spine. This would help with @pgraverdy's work where we cannot rely on Bazel runfiles any more.
Circling back on this, can we just not set `params.floor` to false and pass the known ground plane URDF in `params.extra_urdf_paths`?

cc @pgraverdy
Yes, and once that works, you can remove `params.floor` altogether :wink: 

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bbc5de2b..4ca4fe79 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
 
 ### Removed
 
+- BulletInterface: Removed hardcoded ground plane URDF
 - Bazel: dependencies based on ``pip_parse`` from ``rules_python``
 
 ## [2.1.0] - 2024-01-03
diff --git a/vulp/actuation/BulletInterface.cpp b/vulp/actuation/BulletInterface.cpp
index a5ffe0bb..5e991a39 100644
--- a/vulp/actuation/BulletInterface.cpp
+++ b/vulp/actuation/BulletInterface.cpp
@@ -42,9 +42,6 @@ BulletInterface::BulletInterface(const ServoLayout& layout,
     bullet_.setGravity(btVector3(0, 0, -9.81));
   }
   bullet_.setRealTimeSimulation(false);  // making sure
-  if (params.floor) {
-    bullet_.loadURDF(find_plane_urdf(params.argv0));
-  }
 
   // Load robot model
   robot_ = bullet_.loadURDF(params.urdf_path);
diff --git a/vulp/actuation/BulletInterface.h b/vulp/actuation/BulletInterface.h
index 969e12eb..cf64f810 100644
--- a/vulp/actuation/BulletInterface.h
+++ b/vulp/actuation/BulletInterface.h
@@ -97,9 +97,6 @@ class BulletInterface : public Interface {
     //! Simulation timestep in [s]
     double dt = std::numeric_limits<double>::quiet_NaN();
 
-    //! If true, add a horizontal floor at height z=0 in the inertial frame.
-    bool floor = true;
-
     //! Translate the camera to follow the robot
     bool follower_camera = false;
 


Test patch:
diff --git a/vulp/actuation/tests/BulletInterfaceTest.cpp b/vulp/actuation/tests/BulletInterfaceTest.cpp
index be6154e8..beeaac57 100644
--- a/vulp/actuation/tests/BulletInterfaceTest.cpp
+++ b/vulp/actuation/tests/BulletInterfaceTest.cpp
@@ -40,7 +40,6 @@ class BulletInterfaceTest : public ::testing::Test {
 
     BulletInterface::Parameters params(config);
     params.dt = 1.0 / 1000.0;
-    params.floor = false;  // wheels roll freely during testing
     params.joint_friction.try_emplace("left_wheel", kLeftWheelFriction);
     params.urdf_path = runfiles->Rlocation("upkie_description/urdf/upkie.urdf");
     interface_ = std::make_unique<BulletInterface>(layout, params);