-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Implement ROS wrench publishing #26
base: noetic-devel
Are you sure you want to change the base?
Conversation
In the ROS ecosystem, force-torque data is often available from one source as a 6-element `geometry_msgs/Wrench` or its stamped variant. Having such a single composite data source eliminates the need for the client or the user side to implement some synchronization between the separate force and torque topics, bringing the simulation closer to how a real-world system would function.
Thanks for the suggestion! When I implemented the sensors this was bothering me, too. I see no issues with your implementation, however, maybe it makes sense to go even one step further and provide some kind of Currently, only IMUs come to mind, but I'm certain there are more combined sensors this implementation would benefit from. Can you think of more?
I'm not sure I understand what you intend with the first todo. My suggestion for the second one would be to either register either single sensor instances or combined sensor instances. Single sensor instances would behave just like before, and combined sensors would publish a combined topic and individual topics for the included sensors. By checking the subscriber count we could then prevent unnecessary serialization while still providing flexible access to the data. |
That one was more of a note for me for now.
In any case, if I understood correctly, you suggest registering only the combined sensor (and not the single sensors of which it consists) and publishing the values for the single or combined topics as needed from there -- that would take care of the resampling discrepancy.
Perhaps Pose, Twist; these too have MuJoCo sensors for their components but not combined.
Yes, that makes sense. I will see what I can do. |
yes, exactly. Probably it would be best to use an inheritance pattern like
and class GeneralSensorConfig {
public:
// Iterate through registered sensors, and register on matching SensorNoiseModel.sensor_name
virtual void registerNoise(std::vector<mujoco_ros_msgs::SensorNoiseModel> noise);
// For each registered sensor(-pair) fetch data, convert to message and publish
virtual void publishSensorsData(mjDataPtr data, bool gt_enabled);
// and some initialization related functions
...
}
class SingleSensorConfig : GeneralSensorConfig {
....
private:
std::string frame_id;
int sensor_type;
int sensor_adr;
ros::Publisher sensor_data;
ros::Publisher gt_sensor_data;
// we could also add a configurable sensor publishing rate
}
... maybe with templated conversion functions for mujoco sensor addresses in the data vectors for the different sensor types. And then we would just register sensors configurations into a vector on init and call the main functions defined by GeneralSensorConfig for processing in the lastStageCallback. At least that's my rough idea without having thought too hard about it yet. We can discuss this in more detail and modify the draft after the IROS .
I started an additional todo list above so that we can track them better :) |
53acd70
to
455e135
Compare
fc32993
to
d2fb871
Compare
In the ROS ecosystem, force-torque data is often available from one source as a 6-element
geometry_msgs/Wrench
or its stamped variantgeometry_msgs/WrenchStamped
.Having such a single composite data source eliminates the need for the client or the user side to implement some synchronization between the separate force and torque topics, bringing the simulation closer to how a real-world system would function.
Configuration in the MJCF
The feature will look for a custom tuple named
"wrench"
in the model.TODOs
Combined Sensors to Consider