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

Droter's profile - activity

2021-03-10 08:27:46 -0500 received badge  Famous Question (source)
2020-04-06 11:08:09 -0500 received badge  Notable Question (source)
2020-02-25 16:49:23 -0500 received badge  Taxonomist
2020-02-04 21:22:49 -0500 answered a question How to convert Twist msg to PWM signals?

This will convert the Twist to Ackermann messages: http://wiki.ros.org/teb_local_planner/Tutorials/Planning%20for%20car-

2019-11-07 10:30:51 -0500 received badge  Popular Question (source)
2019-06-28 15:04:59 -0500 received badge  Notable Question (source)
2019-06-28 15:04:59 -0500 received badge  Famous Question (source)
2019-05-31 12:04:17 -0500 asked a question Generic Chemical Sensor Message

Generic Chemical Sensor Message We are interested in extending the ROS sensor_msgs with a chemical sensor message. It wo

2019-04-24 02:34:24 -0500 received badge  Notable Question (source)
2019-04-24 02:34:24 -0500 received badge  Famous Question (source)
2019-04-24 02:34:24 -0500 received badge  Popular Question (source)
2018-07-31 07:40:00 -0500 received badge  Student (source)
2018-07-31 07:39:57 -0500 received badge  Self-Learner (source)
2018-07-30 17:20:47 -0500 marked best answer Call service from arduino?

Hi,

I am trying to call a ROS service to turn on/off relays from an arduino. The service works from the command line and also from a python service client call. How do I call a service from an arduino?

The relay service message is:

int32 channel
bool  state
---
bool success

I made the ros_lib library and the new service is listed.

rosrun rosserial_client make_libraries .

How do you call the service?

#include <WProgram.h>
#include "ros.h"
#include <ros/service_client.h>
#include "turtlebot/relayCmd.h"


ros::NodeHandle nh;
ros::ServiceClient<turtlebot::relayCmd::Request, turtlebot::relayCmd::Response> client("/relay_cmd");
turtlebot::relayCmd::Request relay_request;
turtlebot::relayCmd::Response response;

void setup() {
  nh.initNode();

  nh.getHardware()->setBaud(57600);

  while (!nh.connected())
  {
      nh.spinOnce();
  }
  nh.loginfo("Teensy is connected");
  delay(1);
}

void loop() {
    relay_request.channel = 2;
    relay_request.state = 1;

    response.success = false;

    nh.loginfo("Calling relay server");

    if ( client.call(relay_request, response) ) {
      nh.loginfo("service callback true");
    }
    delay(1000);
}

Error Message during compiling:

   Compiling .pioenvs/teensy31/src/main.cpp.o
src/main.cpp: In function 'void loop()':
src/main.cpp:42:21: error: could not convert 'client.ros::ServiceClient<MReq, MRes>::call<turtlebot::relayCmdRequest, turtlebot::relayCmdResponse>(relay_request, response)' from 'void' to 'bool'
if ( client.call(relay_request, response) ) {
2018-07-30 17:20:36 -0500 answered a question Call service from arduino?

Followed the format on this post: https://answers.ros.org/question/38719/ros-service-client-arduino-not-publishing/ It

2018-07-30 15:37:30 -0500 asked a question Call service from arduino?

Call service from arduino? Hi, I am trying to call a ROS service to turn on/off relays from an arduino. The service wo

2018-07-19 03:52:16 -0500 received badge  Popular Question (source)
2018-06-22 12:14:21 -0500 commented question hardware interface device for real time control

This is a new package in ROS2 currently under development for microcontrollers that uses real time. https://github.com/m

2018-06-22 12:14:21 -0500 received badge  Commentator
2018-06-22 09:34:00 -0500 answered a question Is there a convention where to put resource files inside a package?

Hi nbro, In the Package Organization from the ROS Best Practices https://github.com/ethz-asl/ros_best_practices/wiki#pa

2018-05-07 09:06:11 -0500 commented question navsat_serial GPS [Errno 111] Connection refused

Yes, this was an issue on my local computer. Tried on another and it works correctly.

2018-04-30 17:23:50 -0500 answered a question Mobile robot simulation with which simulator?

Hi Max, You might look into https://github.com/Microsoft/AirSim They are working on a ROS bridge. See issue: https://

2018-04-29 12:43:32 -0500 asked a question navsat_serial GPS [Errno 111] Connection refused

navsat_serial GPS [Errno 111] Connection refused Hi, I have a BU-353s4 GPS and I am getting this error when trying to s

2018-02-13 10:05:31 -0500 received badge  Famous Question (source)
2017-02-13 09:29:27 -0500 received badge  Popular Question (source)
2017-02-13 09:29:27 -0500 received badge  Notable Question (source)
2017-02-13 09:29:27 -0500 received badge  Famous Question (source)
2017-01-30 10:59:57 -0500 marked best answer Convert Raw Velodyne VLP16 pcap to bagFile

Hi,

I have some raw velodyne VLP16 data in a pcap file. Is there a way to convert it to a ros bagFile?

Here is a link to the raw log file: https://goo.gl/MJDfWA

Thanks,

Matt

2016-11-15 10:37:51 -0500 received badge  Famous Question (source)
2016-11-15 10:37:51 -0500 received badge  Notable Question (source)
2016-06-28 04:28:27 -0500 marked best answer Publish CAN frame on topic

Hi,

I am trying to publish CAN data to a ROS topic. I followed the talker tutorial and am using the suggestion on this question: http://answers.ros.org/question/21364...

#include "ros/ros.h"
#include "std_msgs/String.h"
#include <sstream>
#include "socketcan_interface/socketcan.h"
#include "socketcan_interface/threading.h"
#include "socketcan_interface/string.h"

void handleFrames(const can::Frame &f){
    // handle all frames
    LOG(can::tostring(f, true)); // lowercase: true
}
void handleFrame123(const can::Frame &f){
    // handle specific frame
    LOG("123? " << can::tostring(f, true)); // lowercase: true
}

int main(int argc, char **argv)
{
    can::ThreadedSocketCANInterface driver;
    if(!driver.init("can0", false)) return 1; // read own messages: false

    can::CommInterface::FrameListener::Ptr all_frames = driver.createMsgListener(handleFrames);
    can::CommInterface::FrameListener::Ptr one_frame = driver.createMsgListener(can::MsgHeader(0xFF32), handleFrame123); // handle only frames with CAN-ID 0x123

    ros::init(argc, argv, "data_raw");
    ros::NodeHandle n;
    ros::Publisher canbus_pub = n.advertise<std_msgs::String>("canbus", 1000);

    while (ros::ok())
    {
      std_msgs::String msg;
      std::stringstream ss;

      ss << all_frames;
      msg.data = ss.str();
      canbus_pub.publish(msg);

      //ROS_INFO("%s", msg.data.c_str());

      //ROS_INFO("%s", std::cout<<"all_frames is of type: "<<typeid(all_frames).name()<<std::endl);

      ros::spinOnce();
    }

  driver.shutdown();
  return 0;
}

This line LOG(can::tostring(f, true) will print the CAN frame to the console like:

00063200#8000010100000000
00061200#0000010100000000
00063200#8000010100000000
00EF0900#0000000000000000
00061200#0000010100000000
00063200#8000010100000000
00061200#0000010100000000
00063200#8000010100000000

This line canbus_pub.publish(msg) prints to a rostopic canbus but no frame data:

---
data: 0x1e9db80
---
data: 0x1e9db80

How do I get the individual CAN frames to print to the topic?

Thanks,

Matt

2016-04-26 16:15:56 -0500 answered a question Installing Gazebo2

No armhf debs for gazebo2 in repository.

Thanks ahendrix

2016-04-26 14:37:46 -0500 commented question Installing Gazebo2

I can see gazebo5-common and gazebo5-doc and that is all

2016-04-26 14:37:06 -0500 commented question Installing Gazebo2

is it different if I am on an arm processor?

2016-04-26 12:55:33 -0500 edited question Installing Gazebo2

Hi,

I am running ROS indigo and trying to install Gazebo2. Trying to follow these instructions: http://gazebosim.org/tutorials/?tut=r...

I have deb http://packages.ros.org/ros/ubuntu trusty main listed in my sources.

When I do an apt-cache search only gazebo5 shows up.

Any ideas?

Thanks,

Matt