Skip to content

Commit

Permalink
Merge branch 'main' into iron_wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ted-miller authored Nov 11, 2024
2 parents 19a2ee4 + 225ed07 commit b45833c
Show file tree
Hide file tree
Showing 24 changed files with 509 additions and 264 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_md_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v16
- uses: DavidAnson/markdownlint-cli2-action@v17
with:
globs: "**/*.md"
6 changes: 3 additions & 3 deletions .github/workflows/ci_msbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ jobs:
# officially matrix doesn't support non-scalar values, but it does
# seem to work, so let's use it.
uros: [
{ release: 20240710, codename: foxy },
{ release: 20240710, codename: galactic },
{ release: 20240710, codename: humble },
{ release: 20240917, codename: foxy },
{ release: 20240917, codename: galactic },
{ release: 20240917, codename: humble },
]

steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,4 @@ libmicroros_yrc1000u_iron/

# M+ build output
*.out
/libmicroros_yrc1000_iron
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,10 @@ The following general requirements must be met in order to be able to use MotoRO
- `YAS2.80.00-00` for YRC1000
- `YBS2.45.00-00` for YRC1000micro
- the controller must have a correctly configured network connection:
- DX200: `LAN`
- DX200 and YRC1000micro: `LAN`
- YRC1000: either `LAN2` or `LAN3`
- YRC1000micro: either `LAN2` or `LAN3`
- ROS 2 version: Foxy, Galactic, Humble or Iron
MotoROS2 does not support ROS 2 Iron Irwini, nor Jazzy nor Rolling Ridley.
- ROS 2 version: Foxy, Galactic, Humble or Iron.
MotoROS2 does not support ROS 2 Jazzy nor Rolling Ridley.
- Docker or a from-source build of the micro-ROS Agent
- FastDDS as RMW (even when using ROS 2 Galactic)

Expand Down
36 changes: 34 additions & 2 deletions config/motoros2_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ sync_timeclock_with_agent: true
# To disable auto-detection, uncomment 'userlan_monitor_port' below and set
# it to the desired port.
#
# NOTE: this setting only applies to YRC1000 and YRC1000u controllers.
# DX200 and FS100 controllers only have a single ethernet port, and any
# NOTE: this setting only applies to YRC1000 controllers. YRC1000u, DX200,
# and FS100 controllers only have a single ethernet port, and any
# value other than 1 will be ignored.
#
# NOTE 2: auto-detection is not perfect. It can't determine whether the Agent
Expand Down Expand Up @@ -286,3 +286,35 @@ publisher_qos:
#
# DEFAULT: false
#ignore_missing_calib_data: false

#-----------------------------------------------------------------------------
# Should MotoROS2 broadcast debug messages?
#
# If enabled, this will broadcast log messages on the network on port UDP 21789.
# The user can use the debug script to monitor the state of the robot, identify
# problems, and debug their code.
#
# The debug script is available under the Yaskawa-Global/motoros2 repository in
# the tools directory
# https://github.com/Yaskawa-Global/motoros2/tree/main/tools
#
# DEFAULT: true
#debug_broadcast_enabled: true

#-----------------------------------------------------------------------------
# Which network port(s) should MotoROS2 broadcast debug messages on, if
# 'debug_broadcast_enabled' is 'true'?
#
# If not specified and 'debug_broadcast_enabled' is true, MotoROS2 will
# send messages over all network ports which are active on the controller.
#
# To choose a specific port to broadcast debug messages, uncomment
# 'debug_broadcast_port' below and set it to the desired port.
#
# NOTE 1: this setting only applies to YRC1000 controllers. YRC1000u,
# DX200, and FS100 controllers only have a single ethernet port,
# and will always default to USER_LAN1
#
# OPTIONS: USER_LAN1, USER_LAN2
# DEFAULT: (all available network ports)
#debug_broadcast_port: USER_LAN1
41 changes: 39 additions & 2 deletions doc/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,21 @@ Save a copy of the output of the [debug-listener script](#debug-log-client) and
Open a new issue on the [Issue tracker](https://github.com/yaskawa-global/motoros2/issues), describe the problem and attach `PANELBOX.LOG` and the debug log to the issue.
Include a verbatim copy of the alarm text as seen on the teach pendant (alarm number and `[subcode]`).

### Alarm: 8011[64]

*Example:*

```text
ALARM 8011
Enable LAN port 1 for debug
[64]
```

*Solution:*
The ETHERNET function must be enabled for the LAN interface that was specified in the config file.
Either change the interface specified in the config file to a LAN interface that is enabled, or enable the corresponding LAN interface on the controller.
Please contact your local Yaskawa representative to request the ETHERNET function if it is not enabled.

### Alarm: 8012[xx]

*Example:*
Expand Down Expand Up @@ -932,7 +947,7 @@ ALARM 8013
The `userlan_monitor_port` key in the `motoros2_config.yaml` configuration file is set to an invalid value.
LAN port monitoring will be disabled for this session.

On YRC1000 and YRC1000u, this must be set to either `USER_LAN1` or `USER_LAN2`.
On YRC1000, this must be set to either `USER_LAN1` or `USER_LAN2`.

No other values are supported.

Expand All @@ -958,7 +973,7 @@ To rule out a transient failure, reboot the controller.

If the alarm is raised again, and if auto-detection is not needed or desired, make sure `userlan_monitor_port` is not commented out (ie: does not have a `#` at the start of the line) and set it to an appropriate value.

On YRC1000 and YRC1000u, set it to either `USER_LAN1` or `USER_LAN2`, depending on which LAN port is used to connect the controller to the PC running the micro-ROS Agent application.
On YRC1000, set it to either `USER_LAN1` or `USER_LAN2`, depending on which LAN port is used to connect the controller to the PC running the micro-ROS Agent application.

If auto-detection is to be used, verify `agent_ip_address` is set to an IP that can be reached by MotoROS2 over the LAN port which is connected to the PC running the micro-ROS Agent application (either directly, or via a default gateway configured on the controller).

Expand Down Expand Up @@ -1024,6 +1039,28 @@ In case the alarm is still raised after calibration was performed, TF broadcasti
Open a new issue on the [Issue tracker](https://github.com/yaskawa-global/motoros2/issues), describe the problem and attach `PANELBOX.LOG`, `RBCALIB.DAT` and the debug log to the issue.
Include a verbatim copy of the alarm text as seen on the teach pendant (alarm number and `[subcode]`).

### Alarm: 8013[17]

*Example:*

```text
ALARM 8013
Bad UserLan debug port in cfg
[17]
```

*Solution:*
The `debug_broadcast_port` key in the `motoros2_config.yaml` configuration file is set to an invalid value.
Debug messages will be sent over all active network ports

On YRC1000, this must be set to either `USER_LAN1` or `USER_LAN2`.

No other values are supported.

Example: `debug_broadcast_port: USER_LAN1`.

After correcting the configuration, the [changes will need to be propagated to the Yaskawa controller](../README.md#updating-the-configuration).

### Alarm: 8014[0]

*Example:*
Expand Down
68 changes: 6 additions & 62 deletions src/ActionServer_FJT.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,82 +247,26 @@ rcl_ret_t Ros_ActionServer_FJT_Goal_Received(rclc_action_goal_handle_t* goal_han
if (!bSizeOk)
{
motomanErrorCode = INIT_TRAJ_TOO_BIG;
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Trajectory contains too many points (Not enough memory).");
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
Ros_ErrorHandling_Init_Trajectory_Status_ToString((Init_Trajectory_Status) motomanErrorCode));
}
else if (!bMotionReady)
{
motomanErrorCode = Ros_Controller_GetNotReadySubcode();
motomanErrorCode = Ros_Controller_GetNotReadySubcode(false);
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
Ros_ErrorHandling_MotionNotReadyCode_ToString((MotionNotReadyCode)motomanErrorCode));
}
else if (!bMotionModeOk)
{
motomanErrorCode = INIT_TRAJ_WRONG_MODE;
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Must call " SERVICE_NAME_START_TRAJ_MODE " service.");
Ros_ErrorHandling_Init_Trajectory_Status_ToString((Init_Trajectory_Status) motomanErrorCode));
}
else if (!bInitOk)
{
motomanErrorCode = trajStatus;
switch (motomanErrorCode)
{
case INIT_TRAJ_TOO_SMALL:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Trajectory must contain at least two points.");
break;
case INIT_TRAJ_INVALID_STARTING_POS:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"The first point must match the robot's current position.");
break;
case INIT_TRAJ_INVALID_VELOCITY:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"The commanded velocity is too high.");
break;
case INIT_TRAJ_ALREADY_IN_MOTION:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Already running a trajectory.");
break;
case INIT_TRAJ_INVALID_JOINTNAME:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Invalid joint name specified. Check motoros2_config.yaml.");
break;
case INIT_TRAJ_INCOMPLETE_JOINTLIST:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Trajectory must contain data for all joints.");
break;
case INIT_TRAJ_INVALID_TIME:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Invalid time in trajectory.");
break;
case INIT_TRAJ_BACKWARD_TIME:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Trajectory message contains waypoints that are not strictly increasing in time.");
break;
case INIT_TRAJ_WRONG_NUMBER_OF_POSITIONS:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Trajectory did not contain position data for all axes.");
break;
case INIT_TRAJ_WRONG_NUMBER_OF_VELOCITIES:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Trajectory did not contain velocity data for all axes.");
break;
case INIT_TRAJ_INVALID_ENDING_VELOCITY:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"The final point in the trajectory must have zero velocity.");
break;
case INIT_TRAJ_INVALID_ENDING_ACCELERATION:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"The final point in the trajectory must have zero acceleration.");
break;
case INIT_TRAJ_DUPLICATE_JOINT_NAME:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"The trajectory contains duplicate joint names.");
break;
default:
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
"Trajectory initialization failed. Generic failure.");
}
rosidl_runtime_c__String__assign(&fjt_result_response.result.error_string,
Ros_ErrorHandling_Init_Trajectory_Status_ToString(trajStatus));
}

fjt_result_response.result.error_code = RESULT_REPONSE_ERROR_CODE(control_msgs__action__FollowJointTrajectory_Result__INVALID_GOAL, motomanErrorCode);
Expand Down
2 changes: 1 addition & 1 deletion src/CommunicationExecutor.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void Ros_Communication_ConnectToAgent()
"Must enable ETHERNET function");
}

#if defined (YRC1000) || defined (YRC1000u)
#if defined (YRC1000)
//Try second interface if first one didn't succeed
if (status != OK && (status = Ros_GetMacAddress(ROS_USER_LAN2, macId)) != OK)
{
Expand Down
Loading

0 comments on commit b45833c

Please sign in to comment.