Conversation
|
@Juliaj FYI |
@saikishor, thanks, this is awesome. I can think two use cases immediately
Will look for opportunities to utilize it. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #133 +/- ##
==========================================
+ Coverage 72.89% 72.92% +0.02%
==========================================
Files 9 12 +3
Lines 2509 2567 +58
Branches 248 266 +18
==========================================
+ Hits 1829 1872 +43
- Misses 572 579 +7
- Partials 108 116 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
The velocimeter part yes. If you want any other link, other than the floating base this should be the way to use it. The floating base part is already integrated in the simulator. Regarding the reward calculation, I don't think it makes sense here during sim-to-sim You can use this to have the contact detection as you wanted initially 😊 |
|
@eholum The pixi build is now failing when added new packages. I'll try to take a look at it |
eholum-nasa
left a comment
There was a problem hiding this comment.
This is great! Mostly just minor nits. @Juliaj I'd be curious to know more about your thoughts, too, if you had the time to take a look!
| // Default: load the heartbeat publisher plugin | ||
| RCLCPP_INFO(get_logger(), "No 'mujoco_plugins' parameter found, loading default HeartbeatPublisherPlugin"); |
There was a problem hiding this comment.
Did you mean to throw the heartbeat plugin into the list here?
That said, do we want this to be loaded by default? It's pretty innocuous I suppose.
There was a problem hiding this comment.
You are right. In my previous implementation i was using it to test it's functionality
| // find the motion key: after 'motions.', and before the next '.' | ||
| const auto plugin_key = param.substr(init_position, param.find_first_of('.', init_position) - init_position); | ||
| // Add the motion to the set of unique values |
There was a problem hiding this comment.
| // find the motion key: after 'motions.', and before the next '.' | |
| const auto plugin_key = param.substr(init_position, param.find_first_of('.', init_position) - init_position); | |
| // Add the motion to the set of unique values | |
| // find the plugin key: after 'motions.', and before the next '.' | |
| const auto plugin_key = param.substr(init_position, param.find_first_of('.', init_position) - init_position); | |
| // Add the plugin to the set of unique values |
| // Load MuJoCo ROS2 Control plugins | ||
| try |
There was a problem hiding this comment.
I'm annoying, but would you mind kicking this out to an internal helper function just for clarity and to make the init method a little shorter?
| virtual bool init(rclcpp::Node::SharedPtr node, const mjModel* model, mjData* data) = 0; | ||
|
|
||
| /** | ||
| * @brief Update the plugin (called every simulation step) |
There was a problem hiding this comment.
I think this is called during read right? So it will run at the control loop rate? Might be worth calling it out.
| void HeartbeatPublisherPlugin::update(const mjModel* /*model*/, mjData* data) | ||
| { | ||
| auto current_time = std::chrono::steady_clock::now(); | ||
| auto elapsed = std::chrono::duration_cast<std::chrono::seconds>(current_time - last_publish_time_); |
There was a problem hiding this comment.
Not sure if it was intentional or not but did you want to use the sim time here rather than wall clock time? They might be different! Not a big deal either way since it's an example, but I would explicitly call it out.
There was a problem hiding this comment.
Now that you say, it makes sense.
Maybe I should also forward the rclcpp::Time here? That way everyone can use it for the timestamp to publish data
There was a problem hiding this comment.
What do you think about it?
There was a problem hiding this comment.
I think users (and we) have options! Could either just use the node's time since that will pull the sim time, or even just the data->time if that's what people are interested in? I don't think we explicitly have to pass the time stamp through here?
This PR proposes an approach to easily integrate the user's code to fetch information from the mujoco system hardware component, and decouples the complexity into the main code, and also gives the user some flexibility.