-
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
Add Compound Sensors #32
base: noetic-devel
Are you sure you want to change the base?
Conversation
@balandbal, this is what I came up with based on our discussion. Could you take a look and tell me what you think? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## noetic-devel #32 +/- ##
================================================
- Coverage 71.43% 61.87% -9.56%
================================================
Files 10 12 +2
Lines 1414 1602 +188
================================================
- Hits 1010 991 -19
- Misses 404 611 +207 ☔ View full report in Codecov by Sentry. |
I'd say this is reasonable behaviour. I don't remember a case when I needed the components of, e.g., a wrench signal separately available in ROS at the same time I used the compound signal.
I'd say yes. These compound signals should correspond to those from some real-world hardware; I'm not aware of a tool that would be "distributed" in the sense that it would require different frames to model.
I'd be happier if the grouping of the sensors could move with the MJCF and not separately, though this is because I usually use my models with, e.g., the official Python bindings as well and not only The mujoco_ros_sensors/config/example_sensors.yaml file would look something like the XML below with the custom tag. <custom>
<tuple name="IMUSensor">
<element objname="test_imu" objtype="tuple" prm="500" />
<element objname="test_imu_2" objtype="tuple" />
</tuple>
<tuple name="WrenchSensor">
<element objname="test_wrench" objtype="tuple" prm="500"/>
</tuple>
<tuple name="TwistSensor">
<element objname="test_twist" objtype="tuple" prm="500"/>
</tuple>
<tuple name="PoseSensor">
<element objname="test_pose" objtype="tuple" prm="250" />
</tuple>
<tuple name="test_imu">
<element objname="linacc_EE" objtype="sensor"/>
<element objname="gyro_EE" objtype="sensor"/>
<element objname="quat_EE" objtype="sensor"/>
</tuple>
<tuple name="test_imu_2">
<element objname="linacc_2" objtype="sensor"/>
<element objname="gyro_2" objtype="sensor"/>
<element objname="quat_2" objtype="sensor"/>
</tuple>
<tuple name="test_wrench">
<element objname="force_EE" objtype="sensor"/>
<element objname="torque_EE" objtype="sensor"/>
</tuple>
<tuple name="test_twist">
<element objname="linvel_EE" objtype="sensor"/>
<element objname="angvel_EE" objtype="sensor"/>
</tuple>
<tuple name="test_pose">
<element objname="pos_joint1" objtype="sensor"/>
<element objname="quat_joint1" objtype="sensor"/>
</tuple>
</custom> |
Alright then let's keep this as is.
What I was worrying about was correct reference frames of the sensor readings. Torques, for instance, only make sense if their reference frame, i.e., their frame_id in ROS, is set correctly. Since a compound sensor could technically consist of arbitrarily far apart sensors, a misconfigured torque sensor could send torques in reference to its local frame instead of the compound sensor frame. I guess we could pin the responsibility of correct configuration to the user, but I'd be happier with sanity checks.
I was unhappy with the separated definition, too. |
Yes, I would be happy with that. |
fc32993
to
d2fb871
Compare
This PR, based on the discussion in #26, overhauls the MuJoCo sensor to ROS serialization and introduces compound sensors.
The currently available compound sensors are Twist, IMU, Wrench, and Pose. New ones can easily be added.
Points to Discuss
Since the custom tag does not really allow adding all this information conveniently, I moved the whole configuration to the plugin configuration.
TODOs