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

Canopen_chain_node does not update values ​​from the device

asked 2018-06-08 08:21:00 -0500

Dizett gravatar image

.yaml file

 bus:
  device: can0
  loopback: true # socket should loop back messages
    #  driver_plugin: can::SocketCANInterface
    #  master_type: canopen::Master::Allocator
      master_allocator: canopen::SimpleMaster::Allocator
    sync:
      interval_ms: 10
      update_ms: 10
      overflow: 0
nodes:
  node1:
    id: 0x05
    eds_file: /eds/my_eds.eds
    publish: ["6004!"]

.launch file

    <launch>
  <arg name="yaml"/>
  <node name="canopen_chain" pkg="canopen_chain_node" type="canopen_chain_node" output="screen" respawn= "true" clear_params="true">
    <rosparam command="load" file="$(find base_control_pkg)/eds/my_yaml.yaml" />
  </node>
  <node pkg="rosservice" type="rosservice" name="driver_init" args="call /driver/init" />

</launch>

if I write

rostopic echo /node1_6004

value is not updated

.eds file

...
[6004]
ParameterName=Position value
ObjectType=7
AccessType=RO
DataType=0x0007
PDOMapping=1
ObjFlags=0x00000000
...
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2018-06-08 08:58:46 -0500

Mathias Lüdtke gravatar image

Your launch file looks suspicious. Please try to call the service directly. Do get you any errors? To get more output, you can use roslaunch --screen.

Last but not least, you should check the actual CAN messages with candump.

edit flag offensive delete link more

Comments

1

using the Python(not ROS) script, I see the update value. But in c ++ in ROS, the value is not updated, but the same is published as at the time of node start.

Dizett gravatar image Dizett  ( 2018-06-08 09:21:33 -0500 )edit

The original .launch file is taken from canopen_chain_node and added <node pkg="rosservice" type="rosservice" name="driver_init" args="call /driver/init" />

Dizett gravatar image Dizett  ( 2018-06-08 10:42:00 -0500 )edit
1

I doubt that this works properly (order is not defined). Please call it seperately.

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2018-06-08 11:56:06 -0500 )edit

My .yaml file is correct?

Dizett gravatar image Dizett  ( 2018-06-09 05:45:17 -0500 )edit
1

The indention looks wrong.. But most important: Whats the response of the init service?

Mathias Lüdtke gravatar image Mathias Lüdtke  ( 2018-06-09 09:05:48 -0500 )edit

It was so copied. I start the .launch file of the standard node canopen_chain_node, changing the path to the .yaml file. Response of the init service:

    :~$ rosservice call /driver/init 
success: True
message: ''
Dizett gravatar image Dizett  ( 2018-06-13 05:24:10 -0500 )edit

In canopen_chain_node added:

[ INFO] [1528885330.074478483]: Initializing XXX
[ INFO] [1528885330.096531888]: Current state: 1 device error: system:0 internal_error: 0 (OK)
[ INFO] [1528885330.096803218]: Current state: 2 device error: system:0 internal_error: 0 (OK)
EMCY: 85#00000
Dizett gravatar image Dizett  ( 2018-06-13 05:26:57 -0500 )edit

The most interesting is that the first time I can read the value, but it is not updated, but it also publishes the old value

Dizett gravatar image Dizett  ( 2018-06-13 05:33:34 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-08 08:21:00 -0500

Seen: 192 times

Last updated: Jun 08 '18