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

Update old laser_modes/laser-name/output behaviour #3

Open
3 tasks
robert-ros opened this issue Apr 25, 2024 · 0 comments
Open
3 tasks

Update old laser_modes/laser-name/output behaviour #3

robert-ros opened this issue Apr 25, 2024 · 0 comments
Assignees

Comments

@robert-ros
Copy link

robert-ros commented Apr 25, 2024

Description of the problem

From current configuration of robot_packages: sick.yaml

The laser_modes tag has a different behaviour than other tags (inputs, outputs, custom_inputs, custom_outputs),
specifically the output tag

address_registers:
  laser_mode_output: 2001
  current_speed: 2002

laser_modes:    # custom laser modes
  standard:     #  custom name of the mode
    input: 237  # input to read the mode
    output: 0   # value of the register when writing in the modbus address
  docking_station:
    input: 239
    output: 771
  cart:
    input: 240
    output: 257

Current behaviour of laser_modes/laser-name/output

The input and output tag should give the position in the modbus table. The PLC interprets that information as a the position of a bit in a byte. For example for standard/input the value is 237 and in the PLC is the byte 29 (237/8), bit 8 (237%8).

However, laser_modes/<laser-name>/output works different. The decimal number is a binary representation of two bytes to fill in the PLC.

00000000 00000000  --> 0  --> standard
00000011 00000011  --> 771  --> docking_station
00000001 00000001  --> 257  --> cart

The position of the byte is defined in address_registers/laser_mode_output. In this case 2001 which represents the byte 250 in bit 1. This is the bit, which the number 771, 257 or 0 (in binary) will be apply.

How to do

This behaviour was implemented a long time ago because in robot with two lasers, we needed to set one by one manually. Since a long time, the lasers are managed by the PLC, so we only need to send a single byte.

  • The laser_modes/<laser-name>/output has to work with the same logic as the laser_modes/<laser-name>/input
  • Check if current_speed is used and remove it if not
  • Remove address_registers
@robert-ros robert-ros self-assigned this Apr 25, 2024
@robert-ros robert-ros changed the title Remove old laser_modes behaviour Update old laser_modes/laser-name/output behaviour Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant