Coder Social home page Coder Social logo

Comments (9)

gavanderhoorn avatar gavanderhoorn commented on August 15, 2024

Note: this is also an issue with MotoROS1.

from motoros2.

ted-miller avatar ted-miller commented on August 15, 2024

We need to document this error in the readme.
#201 (comment)

They should be seeing a message on the pendant
image

When attempting to start a job (using the pendant), they should get error 0380 Check Position

from motoros2.

gavanderhoorn avatar gavanderhoorn commented on August 15, 2024

Should we instead not have MR2 check whether the home pos is set and raise an appropriate alarm if it isn't?


Edit: or at the very least update the result message returned by start_traj_mode et al.?

from motoros2.

ted-miller avatar ted-miller commented on August 15, 2024

It looks like we already are

Ros_ErrorHandling_ErrNo_ToString(rData.err_no), rData.err_no);

So that's apparently broken.

from motoros2.

gavanderhoorn avatar gavanderhoorn commented on August 15, 2024

You mean we should be seeing:

case 0x3040: return "The home position is not registered";

?

from motoros2.

ted-miller avatar ted-miller commented on August 15, 2024

Yeah. That's what I would have thought.

Though perhaps 0x3040 doesn't apply if the home position has been registered and just needs to be validated. If that's the case, then I don't know of any mechanism to detect that this scenario.

from motoros2.

gavanderhoorn avatar gavanderhoorn commented on August 15, 2024

Just ran into this when testing something for #19:

[...] [...]: Ros_MotionControl_StartMotionMode: enter
[...] [...]: Can't start 'INIT_ROS' because: 'The home position is not registered' (0x3040)
[...] [...]: Ros_MotionControl_StartMotionMode: exit
[...] [...]: Ros_ServiceStartPointQueueMode_Trigger: The INIT_ROS job has not started. Please call start_traj_mode or start_point_queue_mode service (108)

seems this isn't completely broken.

from motoros2.

yai-rosejo avatar yai-rosejo commented on August 15, 2024

I started looking into this issue. I found that the debug statement is occurring at:

motoros2/src/MotionControl.c

Lines 1503 to 1516 in 10d8f00

// Start Job
bzero(&rData, sizeof(rData));
bzero(&sStartData, sizeof(sStartData));
sStartData.sTaskNo = 0;
strncpy(sStartData.cJobName, g_nodeConfigSettings.inform_job_name, MAX_JOB_NAME_LEN);
ret = mpStartJob(&sStartData, &rData);
if( (ret != 0) || (rData.err_no !=0) )
{
//TODO(gavanderhoorn): special check for "job is not loaded"
Ros_Debug_BroadcastMsg(
"Can't start '%s' because: '%s' (0x%04X)", g_nodeConfigSettings.inform_job_name,
Ros_ErrorHandling_ErrNo_ToString(rData.err_no), rData.err_no);
goto updateStatus;
}

The r.Data is not getting out of the BOOL Ros_MotionControl_StartMotionMode function.

This then gets put out into a failure to start in Ros_ServiceStartTrajMode_Trigger:

if (!Ros_MotionControl_StartMotionMode(MOTION_MODE_TRAJECTORY))
{
// update response
response->result_code.value = Ros_Controller_GetNotReadySubcode();
if (response->result_code.value == MOTION_READY || Ros_MotionControl_IsMotionMode_PointQueue() || Ros_MotionControl_IsMotionMode_RawStreaming())
{
//Motion is ready, but the StartTrajMode service failed
//because it's already in a different mode.
response->result_code.value = MOTION_NOT_READY_OTHER_TRAJ_MODE_ACTIVE;
rosidl_runtime_c__String__assign(&response->message,
"Another motion mode is already active. Please call 'stop_traj_mode' service and try again.");
}
else
{
// map to human readable string
rosidl_runtime_c__String__assign(&response->message,
Ros_ErrorHandling_MotionNotReadyCode_ToString((MotionNotReadyCode)response->result_code.value));
}
Ros_Debug_BroadcastMsg("%s: %s (%d)", __func__,
response->message.data, response->result_code.value);
}

Which then calls Ros_Controller_GetNotReadySubcode(), this function doesn't see the warning only that the job has not started via:

// Check operating
if(!Ros_Controller_IsOperating())
return MOTION_NOT_READY_NOT_STARTED;

from motoros2.

yai-rosejo avatar yai-rosejo commented on August 15, 2024

This same problem also occurs in Issue #192 I believe

from motoros2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.