anchor
stringlengths
0
150
positive
stringlengths
0
96k
source
dict
apt update: "Malformed entry 1 in list file"
Question: I am using command sudo apt-get update and this error is coming. How to solve this issue? Malformed entry 1 in list file /etc/apt/sources.list.d/ros-latest.list (Component) E: The list of sources could not be read. I am using ubuntu 18.04 and ros melodic. ros-latest.list content:- deb http://packages.ros.org/ros/ubuntu main Originally posted by Keshav on ROS Answers with karma: 33 on 2018-12-27 Post score: 3 Original comments Comment by jayess on 2018-12-28: What is your question? I don't see any question, just an error or warning without any context. Please see the support page for how to ask a question. Answer: Malformed entry 1 in list file /etc/apt/sources.list.d/ros-latest.list (Component) E: The list of sources could not be read. Something probably went wrong during initial setup of the ROS package repository sources. Most likely this section of the tutorial. Can you show us the contents of ros-latest.list? Use the following command: cat /etc/apt/sources.list.d/ros-latest.list and copy-paste the text from the terminal into your original question text. Use the edit button/link for that. Edit: ros-latest.list content:- deb http://packages.ros.org/ros/ubuntu main I have the impression that this is missing the Ubuntu code name for the release, which in your case probably should be bionic (provided you are actually running Ubuntu Bionic (ie: 18.04). To make sure: what is the output of: lsb_release -sc If that returns an error, or tells you the command lsb_release can't be found, then that is most likely what went wrong. If the command can't be found, install it using sudo apt install lsb-release. Edit 2: it is showing output :- bionic Then something must have gone wrong while executing this line from this section of the tutorial: sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' Can you run this again and check carefully whether any warnings and/or errors are printed? Originally posted by gvdhoorn with karma: 86574 on 2018-12-28 This answer was ACCEPTED on the original site Post score: 3 Original comments Comment by Keshav on 2018-12-28: uploaded it. Comment by Keshav on 2018-12-28: it is showing output :- bionic Comment by Keshav on 2018-12-28: no errors or warnings Comment by gvdhoorn on 2018-12-28: Then what is the output of cat /etc/apt/sources.list.d/ros-latest.list? Comment by Keshav on 2018-12-28: yes, now bionic was mentioned there in that. I ran the command It's working. Thanks for helping me out. Comment by j.clownz on 2019-09-05: this helped, thanks
{ "domain": "robotics.stackexchange", "id": 32216, "tags": "ros-melodic" }
Functional difference between ROS2 spin_some, spin_once, and spin_until_future
Question: I understand that spin_once will just query once, but I'm not sure when spin_some would be a better choice or under what situations it would return. Spin until... is for service callbacks I've seen but any other time that would be helpful? Originally posted by stevemacenski on ROS Answers with karma: 8272 on 2018-07-05 Post score: 10 Answer: spin_once will process one item in the executor, it may or may not be the thing you expect, however. Sometimes you just want to spin one thing at a time periodically, and don't care what it is. Other times you want to spin one thing at a time until something has completed, this is where spin_until_future_complete is useful, as it basically does while(future.not_done()) executor.spin_once(). It's a bit more complicated than that, but essentially that's what it is doing. You could do this yourself, so spin_until_future_complete is just a convenience function. spin_some is slightly different. Basically it spins, executing zero to many items, until it is "idle", basically until there's a time where there is nothing for the executor to do. Some people might assume that spin_some would only process what available when it is called, exiting even if there's more work to be done after a period of time. There's an issue and pull request to try and make it behave that way, but they're still in progress: https://github.com/ros2/rclcpp/issues/471 https://github.com/ros2/rclcpp/pull/472 Originally posted by William with karma: 17335 on 2018-07-08 This answer was ACCEPTED on the original site Post score: 8 Original comments Comment by rhogan on 2019-09-04: I am having trouble finding literature on using ROS2 executors and getting a pub/sub file working. Do you know anywhere I can look to get more information or a hands on tutorial? Comment by aby on 2020-04-09: @rhogan check these out. Python https://index.ros.org/doc/ros2/Tutorials/Writing-A-Simple-Py-Publisher-And-Subscriber/#pypubsub C++ https://index.ros.org/doc/ros2/Tutorials/Writing-A-Simple-Cpp-Publisher-And-Subscriber/#cpppubsub
{ "domain": "robotics.stackexchange", "id": 31204, "tags": "ros, ros2, ardent" }
Equivalence of Krom formulas tractable?
Question: Assume I have two Krom formulas $\psi_1, \psi_2$. Krom formulas are propositional formulas in CNF that have 2 literals in every clause. Each literal can be negated or unnegated. In other words, $\psi_1,\psi_2$ are 2-CNF formulas. For instance: $(x_1 \vee \neg x_2) \land (\neg x_2 \vee x_3 ) \land (x_3 \vee x_4)$ I want to decide whether $\psi_1,\psi_2$ are logically equivalent, i.e., $\psi_1 \leftrightarrow \psi_2$. Equivalently, I want to test whether $F=(\psi_1 \vee \neg\psi_2)\wedge (\neg \psi_1 \vee \psi_2)$ is true for all assignments of $x_1,\dots,x_n$. Is this problem tractable? Answer: Yes, equivalence can be checked in polynomial time (in fact, in quadratic time). I will describe how to test whether $\psi_1 \lor \neg \psi_2$ is true for all assignments. You can do the same for $\neg \psi_1 \lor \psi_2$, and use this to test whether $F$ is a tautology, i.e., whether $\psi_1,\psi_2$ are logically equivalent. I will do this by checking whether $\psi_1 \lor \neg \psi_2$ is false for any assignment, or in other words, whether $\neg(\psi_1 \lor \neg \psi_2)$ is satisfiable. Notice that $$\neg(\psi_1 \lor \neg \psi_2) = \neg \psi_1 \land \psi_2,$$ so it suffices to test satisfiability of $\neg \psi_1 \land \psi_2$ where $\psi_1,\psi_2$ are Krom (2-CNF) formulas. Suppose that $\psi_1 = c_1 \land \cdots \land c_k$ where $c_i$ is the $i$th clause in $\psi_1$. Then $$\neg \psi_1 = (\neg c_1) \lor \cdots \lor (\neg c_k).$$ Therefore $$\begin{align*} \neg \psi_1 \land \psi_2 &= ((\neg c_1) \lor \cdots \lor (\neg c_k)) \land \psi_2\\ &= (\neg c_1 \land \psi_2) \lor \cdots \lor (\neg c_k \land \psi_2). \end{align*}$$ Now, $\neg \psi_1 \land \psi_2$ is satisfiable iff $\neg c_i \land \psi_2$ is satisfiable for some $i$. So, we can iterate over $i$ and test satisfiability of each $\neg c_i \land \psi_2$; if any of them are satisfiable, then $\neg \psi_1 \lor \psi_2$ is satisfiable and $F$ is not a tautology and $\psi_1,\psi_2$ are not logically equivalent. How to test satisfiability of $\neg c_i \land \psi_2$? Well, $c_i$ has the form $(\ell_1 \lor \ell_2)$ where $\ell_1,\ell_2$ are two literals, so $\neg c_i \land \psi_2$ has the form $\neg \ell_1 \land \neg \ell_2 \land \psi_2$. This is also a Krom (2-CNF) formula, so you can test its satisfiability using the standard polynomial-time algorithm. You do a linear number of such tests, so the total running time is polynomial. In fact, it is quadratic, as testing satisfiability can be done in linear time.
{ "domain": "cs.stackexchange", "id": 16633, "tags": "complexity-theory, logic, satisfiability, propositional-logic" }