ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Agju's profile - activity

2022-04-19 08:06:43 -0500 received badge  Supporter (source)
2022-04-19 08:06:41 -0500 commented answer ROS1 -> ROS2: Migration standard

Thanks!! They are all "ambient" sensors (temperature, humidity, etc) that just read data and report to a file. They are

2022-04-16 17:08:07 -0500 received badge  Famous Question (source)
2022-04-13 17:54:35 -0500 received badge  Notable Question (source)
2022-04-13 08:33:07 -0500 received badge  Popular Question (source)
2022-04-13 07:45:16 -0500 received badge  Nice Question (source)
2022-04-13 03:01:09 -0500 received badge  Famous Question (source)
2022-04-13 02:51:52 -0500 asked a question ROS1 -> ROS2: Migration standard

ROS1 -> ROS2: Migration standard HI, I'm trying to migrate a project from ROS1 Melodic to ROS2 now that it is gettin

2021-09-28 05:41:56 -0500 received badge  Notable Question (source)
2021-09-28 05:41:56 -0500 received badge  Popular Question (source)
2019-12-07 09:19:34 -0500 asked a question Remote machine lost after DHCP request

Remote machine lost after DHCP request Hi, I've been running for several days two machines connected to the same router

2018-08-14 18:10:24 -0500 received badge  Notable Question (source)
2017-06-08 05:28:02 -0500 received badge  Popular Question (source)
2017-03-16 03:49:36 -0500 commented question RPI3: Trying to cv::imwrite to external usb

I have created a very simple program using "fopen" and it works flawlessly also: I'm able to write a "file.txt" directly to the USB drive. I think that maybe when "launching" ROS the user/permissions are not the same as running a program directly from CL

2017-03-15 05:01:41 -0500 asked a question RPI3: Trying to cv::imwrite to external usb

I'm trying to save an image received from a callback to an external USB drive using OpenCV3.1 cv::imwrite.

I have mounted the USB into /media/usb with ownership to "pi", and I can move/copy/delete files using CLI without the need of "su" nor "sudo", so I think I did it right.

The problem is that when I try to save an image using cv::imwrite, it simply does not save. I added a ROS_ASSERT to the cv::imwrite, and the node simply shutsdown. I also looked at the logs, but cannot find anything relevant because the node simply shutsdown.

Here's the code:

bool camera::takeScreenshotService(std_srvs::Trigger::Request &req, std_srvs::Trigger::Response &res)
{
    time_t now;
    time(&now);
    struct tm* current_time = localtime(&now);
    char buffer[256];
    strftime(buffer, sizeof(buffer), "%Y-%m-%d_%T", current_time);
    std::string current_time_s(buffer);
    std::string image_name = save_image_path + current_time_s + image_extension;

    ROS_ASSERT( cv::imwrite(image_name, image_rec) );

    res.success = true;
    return true;
}

image_rec is received in the camera callback, and save_image_path and image_extension are global parameters. All these are set correctly, because when I change the path to a "local" path (like /home/pi) it works flawlessly.

Is it possible that I need to change or modify the ownership or persmissions when mounting the USB in order to be able to save files using ROS?

2016-11-15 09:18:05 -0500 received badge  Student (source)
2016-07-26 04:07:37 -0500 received badge  Famous Question (source)
2016-07-15 03:26:37 -0500 received badge  Enthusiast
2016-07-08 08:42:01 -0500 received badge  Notable Question (source)
2016-07-07 10:03:01 -0500 received badge  Popular Question (source)
2016-07-06 06:23:50 -0500 asked a question Cannot read rosserial getParam()

Hi all. I'm trying to implement an Arduino sketch using a Mega2560 which sub/pub data to a RPi 3 with ROS Indigo compiled from source. Everything goes well and without any error.

I'm now trying to update the code, so all the parameters that the Arduino use (PID values, constants, etc.) are catched from the parameter server, configured from the launch file that starts everything. The problem is that altough I can see the parameters with "rosparam list" and "rosparam get", I am not able to read them using the Arduino Mega2560.

The code I use is:

void getParameters()
{
  float pid_left[3];
  float pid_right[3];
  float wheel_radius;
  float wheel_distance;
  int axes_distance;
  nh.getParam("~pid_left", pid_left, 3);
  nh.getParam("~pid_right", pid_right, 3);
  nh.getParam("~wheel_radius", &wheel_radius);
  nh.getParam("~wheel_distance", &wheel_distance);
  nh.getParam("~axes_distance", &axes_distance);
  for (int i = 0; i < 6; i++)
  {
    parameters.float_data[i] = pid_left[i];
    parameters.float_data[i + 3] = pid_right[i];
  }
  parameters.float_data[6] = wheel_radius;
  parameters.float_data[7] = wheel_distance;
  parameters.float_data[8] = axes_distance;
}

void startRos()
{
  nh.getHardware()->setBaud(57600);
  nh.initNode();
  while (!nh.connected())
  {
    nh.spinOnce();
  }
  delay(10);
  getParameters();
}

(I've deleted the default values part for readiness). And the output in the console is:

[ INFO] [1467801488.320667825]: Opening serial port.
[ INFO] [1467801488.321997921]: Starting session.
[INFO] [WallTime: 1467801488.713206] rosserial message_info_service node
[ WARN] [1467801489.323139261]: Sync with device lost.
[ WARN] [1467801490.324296609]: Sync with device lost.
[ INFO] [1467801490.327060089]: Attached client is using protocol VER2 (hydro)
[INFO] [WallTime: 1467801490.350732] Loading module to return info on std_msgs/Float32MultiArray.
[ WARN] [1467801490.352954118]: Received message with unrecognized topicId (6).
[ WARN] [1467801491.355344863]: Received message with unrecognized topicId (6).
[ WARN] [1467801492.362921960]: Received message with unrecognized topicId (6).
[ WARN] [1467801493.366514158]: Received message with unrecognized topicId (6).
[ WARN] [1467801493.366514158]: Received message with unrecognized topicId (6).

I have tried to add a timeout in the readings, making a loop and trying to read each parameter 10 times, but it always ends with the default value, and with that [WARN] appearing.

What I'm doing wrong?

Thanks