Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should I use proxy drvier for TPDO? #315

Open
glaciercoder opened this issue Aug 23, 2024 · 0 comments
Open

How should I use proxy drvier for TPDO? #315

glaciercoder opened this issue Aug 23, 2024 · 0 comments
Labels
question Further information is requested

Comments

@glaciercoder
Copy link

I'm using a servo for robot control and it uses CANOpen for communication. To facilitate the development I use ros2_canopen proxy_driver. The SDO and RPDO works well but PDO doesn't, which means I can receive the data from the servo but I can't control it using ros2_canopen. My bus config is as following:

nodes:
    wheel0_steering:
      node_id: 0x01
      sdo:
        - {index: 0x6081, sub_index: 0, value: 1000} # Rotation Speed
        - {index: 0x6083, sub_index: 0, value: 2000} # Rotation acceleration
        - {index: 0x6060, sub_index: 0, value: 1} # Working mode
        - {index: 0x6040, sub_index: 0, value: 0x0000103f} # enable
      tpdo: # TPDO needed statusword, actual velocity, actual position, mode of operation
        1:
          enabled: true
          cob_id: "auto"
          transmission: 0x01
          mapping:
            - {index: 0x6041, sub_index: 0} # status word
            - {index: 0x6063, sub_index: 0} # position actual value
      rpdo: # RPDO needed controlword, target position, target velocity, mode of operation
        1:
          enabled: true
          cob_id: "auto"
          mapping:
          - {index: 0x607A, sub_index: 0} # target position
          - {index: 0x6040, sub_index: 0} # controlword
          - {index: 0x6060, sub_index: 0} # mode of operation
        2:
          enabled: true
          cob_id: "auto"
          mapping:
          - {index: 0x60FF, sub_index: 0} # target velocity
          - {index: 0x6081, sub_index: 0} # trap velocity

To use proxy driver tpdo, you need to assign index, subindex,data. I wonder what is the correct settings of these. From my knowledge of PDO, I know PDO maps severl objects to one data frame(say target position, control word, mode of operation here), but what is the index and subindex, and how should I set the data?

Besides, I tried to use 0x607A and other members' indices as its index, but nothing happened. I also tried to send three tpdo messages via interface which includes the target position, controlword and mode of operation respectively, still nothing happened and I didn't see any tpdo messages by using candump(but I can see rpdo messages and that works well).

So how should I send tpdo exactly? Please help me.

Thanks a lot!

@glaciercoder glaciercoder added the question Further information is requested label Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant