Ask Your Question
0

trasfer vectors between python and c++ packages

asked 2017-06-04 06:41:42 -0600

ismaisma gravatar image

hi; I want to subscribe a vector from a node written in python to a node written in c++. I use the std::msg float64multiarray type in the two nodes, however, the message is not received Can you help me please Thank you

edit retag flag offensive close merge delete

Comments

Not an answer, but: if by 'vector' you really mean a standard xyz triplet, please try to use geometry_msgs/Vector3 as its semantics are much clearer.

gvdhoorn gravatar imagegvdhoorn ( 2017-06-04 07:09:45 -0600 )edit

the vector is the coordinates of a manipulator and the position with the orientation of a mobile robot, and an instantaneous velocity of the wheels of the mobile system

ismaisma gravatar imageismaisma ( 2017-06-04 07:36:46 -0600 )edit
1

Then I would suggest you use a combination of Pose and JointState, or an Odometry msg. The whole point of ROS is to use as much semantically correct messages as possible. A multi-array throws away any and all meaning the original data might have.

gvdhoorn gravatar imagegvdhoorn ( 2017-06-04 07:39:06 -0600 )edit

I'm new in ROS, how could I combine Pose and JointState msg !!!!

ismaisma gravatar imageismaisma ( 2017-06-04 08:13:40 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-06-04 16:20:37 -0600

ahendrix gravatar image

To pass messages between nodes they need to have the same topic name, the same topic type, and the nodes need to be connected to the same ROS master.

If you're running both nodes on the same computer, they're probably connected to the same ROS master. I wouldn't worry about this unless you're trying to run ROS across multiple machines.

In your code you should be able to see that you're using the same topic name and message type (although the message type syntax is slightly different in python and C++).

When both of your nodes are running, you can use rosnode info with the node name to see which topics your node is actually publishing and subscribing, and if your nodes are connected you'll be able to see the connection between nodes.

You can also use rostopic list to see the list of topics, and rostopic echo to confirm that your publisher is actually publishing messages.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-06-04 06:41:42 -0600

Seen: 48 times

Last updated: Jun 04 '17