ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I figured another way out. I passed Vector3 to my function instead of Float64 and it worked. But still a way for type conversion might be helpful.
There is no conversion defined for Vector3
to Float64
(or really double
, as the error message tells you). I'm also dubious as to how that would work: C++ type conversions are from one value to another, while Vector3
packs three values, so should return another container-like type (a tuple
, vector
or something like that) in order to work.
Is there anyway I can pass vector3 values as vector3.x as parameters to my function ?
Well, yes: geometry_msgs/Vector3
contains x
, y
and z
members, didn't the following work for you?
calc_cartezian_trajectory(..., vector3.x, vector3.y, vector3.z, ...)
If that is really a problem, you could perhaps create an overloaded version of calc_cartezian_trajectory(..)
that does take a geometry_msgs::Vector3
instance, and then calls the one you have now.
PS: slightly off-topic, but cartezian
-> cartesian
.
2 | No.2 Revision |
I figured another way out. I passed Vector3 to my function instead of Float64 and it worked. But still a way for type conversion might be helpful.
There is no conversion defined for Vector3
to Float64
(or really double
, as the error message tells you). I'm also dubious as to how that would work: C++ type conversions are from one value to another, while Vector3
packs three values, so a conversion should return another container-like type (a tuple
, vector
or something like that) in order to work.work. That wouldn't really help that much I believe.
Is there anyway I can pass vector3 values as vector3.x as parameters to my function ?
Well, yes: geometry_msgs/Vector3
contains x
, y
and z
members, didn't the following work for you?
calc_cartezian_trajectory(..., vector3.x, vector3.y, vector3.z, ...)
If that is really a problem, you could perhaps create an overloaded version of calc_cartezian_trajectory(..)
that does take a geometry_msgs::Vector3
instance, and then calls the one you have now.
PS: slightly off-topic, but cartezian
-> cartesian
.