Running a canopen node using only canopen_chain_node and canopen_master [closed]
Hi,
I have recently startet using ros_canopen, but I have a hard time figuring out how it works exactly. Currently I am controlling my robot using socketcan_bridge (socketcan_to_topic and topic_to_socketcan) to just "tap in" on the can bus to read and write using PDO's. I am able to get this to work ok by just setting up the eds files of the motors with appropiate TPDO's and RPDO's.
But I would much rather that I could just set up a canopen node with ros with an eds file and the required RPDO's and TPDO's and the be able to read from the object dictionaries. As i see it I would have to run canopen_motor_node or canopen_402, but Iam using my own driver and not one from ros_control.
I have tried launching the chain.launch within canopen_chain_node using a virtual can bus. But using candump from canUTILS I am not able to pick the heartbeat (or anything else) up. I dont know whether that is because I am using a virtual can bus or something else. I have noticed that the launch doesn't complain if i run it without initializing the virtual bus, so du I have to set the bus up somewhere else than the config yaml? my config yaml:
bus:
device: vcan0 # socketcan network
# loopback: false # socket should loop back messages
# driver_plugin: can::SocketCANInterface
# master_allocator: canopen::SimpleMaster::Allocator
sync:
interval_ms: 10 # set to 0 to disable sync
# update_ms: <interval_ms>
overflow: 0
heartbeat:
rate: 20
msg: "77f#05" # message to send, cansend format heartbeat of node 127 with status 5=Started
defaults:
eds_pkg: canopen_chain_node
eds_file: eds/test2eds.eds
# struct syntax
nodes:
node1:
id: 5
publish: ["60FF"]
So my question is: Is it possible to have a canopen node running, somewhat passively (only being set up with the eds file, but still running with heartbeats and so on) with the canopen_chain_node and/or canopen_master. and if yes how. please forgive me if this seems a trivial question, canopen is entirely new to me and I am also fairly new at programming all in all. but I could really use some help!
Edit: maybe passively wasn't quite the right word to use, what I meant was two things:
Is it possible to set up a node that transmits TPDO's as requested, RPDO's , and a heartbeat as set up in the eds file and that also responds to SDO's and NMT's sent from a master or other nodes on the bus.
furthermore is it possible to have access to the object dictionary to change values and through that change what values are being sent with the TPDO's.
Thank you for your help! as this would greatly improve my setup.
Re-edit: Thanks for the answer, these are just to features I wanted! However as I am doing quite a bit of my work away from the robot i have set up some test code that uses a virtual can and I cannot ...
Please elaborate on what you consider "passive" and what not.
You can upload your project to https://github.com ? I really appreciate your help with this.
How you solved this
could not reset node '1'
?