ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

canopen_chain_node and init device

asked 2018-02-15 09:50:42 -0500

Dizett gravatar image

updated 2018-02-19 01:47:35 -0500

How to init vcan0?

I need to use can::SocketCANInterface ?

can::Frame msg1;
msg1.id = 1;
msg1.data = {1,2,3,4};
  const string driv("vcan0");
  can::SocketCANInterface driver;

  printf("init = %d\n",driver.init(driv, true));
  printf("rec = %d\n",driver.recover());
  printf("state = %d\n",(int)driver.getState().isReady());
  printf("send = %d\n",driver.send(msg1));

Output:

init = 1
rec = 0
state = 0
send = 0

And how to send messages using a dictionary in canopen_chain_node .

canopen_chain_node configured correctly and launched.

Please, help to understand, I am a beginner to ROS.

My .yaml file

Does anyone have an example?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-02-20 11:42:38 -0500

Mathias Lüdtke gravatar image

How to init vcan0?

For setting up vcan, just follow the directions in the driver documentaion, section 6.4

And how to send messages using a dictionary in canopen_chain_node .

You cannot send message using a dictionary. But you can use the (currently undocumented) set_object service to write to the (remote) node object dictionary.

edit flag offensive delete link more

Comments

I don't understand. How do I use canopen_chain_nod to send commands to a device? И как получать сообщения от устройства? Thank You!

Dizett gravatar image Dizett  ( 2018-02-22 03:29:09 -0500 )edit

You have to interact with the corresponding objects of the dictionary. This is device-specific. In most cases these dictionaries are standardized as device profiles. Please stick to English.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2018-02-22 03:45:30 -0500 )edit

How i can to interact with the corresponding objects of the dictionary? I Need to use the topics? I need something to prescribe in .a yaml file for this? Thank You!

Dizett gravatar image Dizett  ( 2018-02-22 04:03:33 -0500 )edit

Just configure and initialize canopen_chain_node and use the provided services.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2018-02-22 04:28:01 -0500 )edit

My .yaml file this is a sufficient configuration?

If i add

node1:
  publish: ["1003sub0!"]

do I have to subscribe to the topic 1003sub0 to receive messages from the device? Or I need to publish in topic for the device?

Dizett gravatar image Dizett  ( 2018-02-22 05:40:35 -0500 )edit

The canopen_chain_node does not care if someone subscribes to the topics. It will just read the object (per SDO or PDO) periodically and publish it at the SYNC/update rate.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2018-02-22 05:50:31 -0500 )edit

an example on Python

self.steer_controller = self.network.add_node(0x01 ,'/home/turtle1/ros/base_control/eds/phyPS409Y.eds')
steer_controller.sdo[0x6411][2].raw = value
Dizett gravatar image Dizett  ( 2018-02-22 06:00:42 -0500 )edit

Does it have to look like this in ros?

  ros::Publisher pub = nh.advertise<std_msgs::Int16>("node2_6411sub2",20);
  ...
  std_msgs::Int16 a;
  pub.publish(a);
Dizett gravatar image Dizett  ( 2018-02-22 06:01:58 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2018-02-15 09:50:42 -0500

Seen: 383 times

Last updated: Feb 20 '18