Closed osrf-migration closed 8 years ago
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
It works fine on gazebo7. I wonder if it's a problem with ignition msgs?
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
I'm suspicious of the difference in field numbering of the vector3d.proto between gazebo (234) and ignition msgs (123):
syntax = "proto2";
package gazebo.msgs;
/// \ingroup gazebo_msgs
/// \interface Vector3d
/// \brief Message for a vector3 double
message Vector3d
{
required double x = 2;
required double y = 3;
required double z = 4;
}
https://bitbucket.org/ignitionrobotics/ign-msgs/src/c67f57a8e5d/ignition/msgs/vector3d.proto
package ignition.msgs;
option java_package = "com.ignition.msgs";
option java_outer_classname = "Vector3dProtos";
/// \ingroup ignition.msgs
/// \interface Vector3d
/// \brief Message for a vector3 double
message Vector3d
{
optional double x = 1;
optional double y = 2;
optional double z = 3;
}
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
Fix issue 2080
→ \<\<cset abc7695a3243874d098210a958a47343ab0060da>>
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
Changing the field numbering did fix the problem. However, I'm not sure why. Gazebo doesn't use ignition messages with the wrench topic.
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
My guess is that gz topic -e
has trouble distinguishing between the two messages. Maybe it's a protobuf bug?
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
I checked that. gz topic
constructs messages using the "gazebo.msgs.Wrench" type via the Gazebo message factory.
I setup a test that also sent a message through the transport system, same as gz topic -e
, and the message printed out correctly. I gave up at this point.
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
I added the following patch to tools/gz_topic.cc
:
diff -r 3884f956f1b9f46e029f1518d31eb1bdcd67efe8 tools/gz_topic.cc
--- a/tools/gz_topic.cc Fri Oct 28 14:11:58 2016 +0000
+++ b/tools/gz_topic.cc Mon Oct 31 15:34:35 2016 -0700
@@ -191,7 +191,11 @@
return;
}
+ std::cout << "intended type: " << msgTypeName << std::endl;
this->echoMsg = msgs::MsgFactory::NewMsg(msgTypeName);
+ std::cout << "actual type: " << this->echoMsg->GetTypeName() << std::endl;
+ std::cout << "message descriptor: " << this->echoMsg->GetDescriptor()->DebugString()
+ << std::endl;
if (!this->echoMsg)
{
then I inserted a box, applied a force torque and gave an echo command:
$ gz topic -e /gazebo/default/unit_box/link/wrench
intended type: gazebo.msgs.Wrench
actual type: ignition.msgs.Wrench
message descriptor: message Wrench {
optional .ignition.msgs.Vector3d force = 1;
optional .ignition.msgs.Vector3d torque = 2;
optional .ignition.msgs.Vector3d force_offset = 3;
}
somehow, it is trying to create a .gazebo.msgs.Wrench
object, but it is getting an ignition one instead.
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
Merged in issue_2080 (pull request #2482)
Fix issue 2080
→ \<\<cset b63d811244382e0d5510a0c8e4c672c7d20c2600>>
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
See issue #2094 for a linking issue that was discovered when resolving this issue.
Original comment by Nate Koenig (Bitbucket: Nathan Koenig).
Original report (archived issue) by Peter Mitrano (Bitbucket: peter_mitrano).
I'm building from source (at de341de4c4495efc4b51c3625d11674d6717a5e3), and I've just noticed that
gz topic -e
on a wrench gives something very weird. It looks like it's skipping the x field, and printing some pointer instead?steps to reproduce:
gz topic -e /gazebo/default/your_model/wrench